Feature #2985
closedMake syntax highlighting pluggable
0%
Description
As discussed in #1651, actual CodeRay support in Redmine is limited, and it could be interesting to make syntax highlighting pluggable. Here is a proposal which keeps actual CodeRay behaviour by default, and allow plugins to implement syntax highlighting. See syntax_highlighting.diff
The second patch prevents Redcloth from escaping some chars when they're in a code block which will be treated by syntax highlighter. There's also a minor change to desactivate a broken (useless?) facility. It doesn't matter for coderay, but other highlighters like Ultraviolet cannot parse code with ampersands everywhere... Note this patch is necessary if you want the plugin below to work well in wikis sections (no impact on attached files). Also note the same kind of trick can easily solve #1416. See redcloth.diff
As an example, I leave a basic plugin to support Ultraviolet syntax highlighting, with active4d theme. It's quite simple, you just have to make your own module under Redmine::SyntaxHighlighting and define some methods. See ultraviolet_highlighter.zip
Any comment about all that is welcome !
Files
Related issues