I've been using SyntaxHighlighter for some time without any problems.
However, I recently restyled my blog and now when one page loads - a page which uses the XML brush - I get a popup saying
Can't find brush for: xml
I've checked and double-checked, and I'm absolutely certain that the shBrushXML.js file is being included in the downloaded JavaScript bundle (I can see SyntaxHighlighter.brushes.Xml
in the minified JS).
I've also tested using other syntaxes on the same page and they're ok; it's just the XML brush.
Does anyone have any ideas why the XML brush is causing this problem?
This was caused by a small bug in another brush script (i.e. another SyntaxHighlighter brush).
I was also referencing a third party Razor syntax brush from here. This script has the line
Which should obviously be
Presumably this has been caused by the author copying the contents of the XML brush and then modifying it for Razor. On its own the XML brush worked, and on its own the Razor brush worked. The XML brush also worked when it was referenced after the Razor brush, and the Razor brush worked when it was referenced after the XML brush.
And now it's clear why.