Question

On a page in our web app we use SyntaxHighlighter to highlight source code. With our current setup, we need to specify all of the suffix-aliases to a certain brush, like this

SyntaxHighlighter.brushes.Ruby.aliases.push('rb');

It would be nice to have a default fallback-brush that can be used in case a file with a previously unknown suffix appears, such as 'ini' or 'txt'.

Has anyone had the same problem? If so, how did you take care of it?

Was it helpful?

Solution

I ended up with checking the file extension in the controller, and if it is not in the set of known extensions (such as .java, .php etc) the brush "shBrushPlain.js" is applied.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top