Last modified: 2013-04-08 11:02:07 UTC
I participate in writing the Wikibook about the Haskell programming language.
GeSHi doesn't support Haskell yet, but it might in the near future (see the feature request - http://sourceforge.net/tracker/index.php?func=detail&aid=1720310&group_id=114997&atid=670234 ).
In the meantime, if i try to write <source lang="haskell">SOME CODE</source>, it is rendered as a Big Red Error that doesn't show any code. I think that it would be better to display the source in the default (black) color with a small warning saying that the language is not supported. This way, when support for that language is added, the warning will go away and the coloring will just start working.
I am not a PHP expert and i don't have an environment to test it, but it looks like it's really easy to change.
Just change the line
return syntaxHighlightHelp( wfMsgHtml( 'syntaxhighlight-err-language' ) );
return $text . syntaxHighlightHelp( wfMsgHtml( 'syntaxhighlight-err-language' ) );
And make syntaxHighlightHelp() and syntaxHighlightError() return more modest error messages.
I hope it helps.
Not a viable patch, includes cross-site scripting injection vector.
It probably wouldn't be a bad idea to go ahead and show the input (properly escaped and <pre>d of course), but I'm not sure about making the warning smaller... listing the supported languages is probably the only way to figure out wtf is going on. :)
[Though in theory that could be moved to a special help page or something and that could be linked.... shrug]
Why not pass the list of supported languages and escaped properly formatted code as $1 and $2 to the error message so this can be decided on a site-by-site basis? I'd say the default should be to display it, yes, that's a much better failure mode, but with a list of supported languages too.
Nod, go ahead and try that.
So how about this ?
still only shows an error message.
Or was something else meant (which may or may not be fixed in the mean time)
No, this isn't fixed. Haskell seems to be supported now, but for unsupported language only an error message is shown.
Done on trunk in r87976