我正在尝试使用语法荧光笔,但它不起作用。 这是你好,世界示例。
<!doctype html>
<html>
<head>
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
</head>
<body>
<pre class"brush:cpp;">
int main()
{
std::cout << "Hello, world!";
return 0;
}
</pre>
<script type="text/javascript">
//SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
</body>
</html>
语法没有突出显示。
最佳答案
你在课后忘记了 =
。
<!doctype html>
<html>
<head>
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
</head>
<body>
<pre class="brush:cpp;">
int main()
{
std::cout << "Hello, world!";
return 0;
}
</pre>
<script type="text/javascript">
//SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
</body>
</html>
关于javascript - 如何使用Alex Gorbatchev编写的最新版(3.0.83)语法高亮工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29328929/