Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top