我在我的 Blogger 博客中使用 SyntaxHighlighter,但有些东西没有按应有的方式工作。在我所有的代码示例中,SyntaxHighlighter 出于某种原因插入了很多新行。此外,它错误地显示数字 9 之后的行数。
这是情况的屏幕截图:
我在</head>
标签上方使用这些脚本来包含 SyntaxHighlighter:
<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 src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
<script language='javascript' type='text/javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
我在做什么错,如何修复 SyntaxHighlighter?
仅供参考,以下是我博客的来源:
<pre class="brush:javascript">
var start = function()
{
var game = new Game(); //The game should now initialize.
//This will:
//Get the canvas.
//Create the renderer.
//Create the scene.
//Create the camera.
//Create the input object.
game.begin(); //Hand over all the control to the game logic.
//This will:
//Begin rendering.
//Begin listening for input.
//Begin updating the game.
}
</pre>