Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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):


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

share|improve this question

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:
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
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

Your Answer


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.