Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I am using syntaxhighlighter on a blogger blog. All is working fine, except when the code I want to show contains a <br/> tag, it gets displayed as a new line. This is despite it being HTML encoded (and the following visible in the view source):

&lt;br/&gt;

Is this a bug in syntaxhighlighter? Or is there anything else I can do to fix it?

share|improve this question
add comment

2 Answers 2

See Blogger Mode.

Blogger Mode Blogger has a nasty habit of replacing all new lines with <br/> tags which makes it impossible to post code snippets. To fix the situation version 1.5.1 introduces "Blogger Mode" which can be enabled before a call to HighlightAll() by a call to BloggerMode() like in the example below:
    dp.SyntaxHighlighter.BloggerMode();
    dp.SyntaxHighlighter.HighlightAll('code');
share|improve this answer
    
it was blogger mode that was the problem. I needed to turn it off –  Mark Heath Oct 6 '10 at 11:02
add comment
up vote 2 down vote accepted

I've worked it out. It was actually turning on syntaxhighlighter's "blogger mode" that caused the problem. Turning it off works just fine.

See line 908 in http://bitbucket.org/alexg/syntaxhighlighter/src/tip/scripts/shCore.js

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.