2

I am using SyntaxHighlighter with my Blogger blog, and something is not working as it should. In all of my code examples, SyntaxHighlighter, for some reason, inserted a lot of new lines. Also, it wrongly displays the number of lines, after the number 9.

Here is a screenshot of the situation: enter image description here

I am using these scripts above my </head> tag to include 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>

What am I doing wrong, how to fix SyntaxHighlighter?

And just for the reference, here's the source from my blog:

<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>
corazza
  • 31,222
  • 37
  • 115
  • 186

1 Answers1

2

This is an issue caused by a change in recent builds of Chrome - what's actually happening with the line numbering is that the line number column isn't expanding to fit correctly, so you're seeing the numbers wrap; after "9", the "1" and "0" are actually "10", etc.

Until an update for SyntaxHighlighter is released, you can fix it yourself by including a modified stylesheet. For instructions, see another question posted last month.

Community
  • 1
  • 1
Kelvin
  • 5,227
  • 1
  • 23
  • 36