Last modified: 2013-04-08 11:02:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10201 - Allow showing code in an unsupported language with a warning
Allow showing code in an unsupported language with a warning
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Brion Vibber
Depends on:
  Show dependency treegraph
Reported: 2007-06-08 18:25 UTC by Amir E. Aharoni
Modified: 2013-04-08 11:02 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Amir E. Aharoni 2007-06-08 18:25:11 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 - ).

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.
Comment 1 Amir E. Aharoni 2007-06-09 07:56:49 UTC
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.
Comment 2 Rob Church 2007-06-13 12:12:57 UTC
Not a viable patch, includes cross-site scripting injection vector.
Comment 3 Brion Vibber 2007-06-13 14:53:09 UTC
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]
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-06-13 18:34:22 UTC
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.
Comment 5 Brion Vibber 2007-06-13 19:36:29 UTC
Nod, go ahead and try that.
Comment 6 Krinkle 2010-07-21 22:23:16 UTC
So how about this ?

<source lang="something">
still only shows an error message.

Or was something else meant (which may or may not be fixed in the mean time)
Comment 7 Amir E. Aharoni 2010-07-21 22:32:51 UTC
No, this isn't fixed. Haskell seems to be supported now, but for unsupported language only an error message is shown.
Comment 8 Brion Vibber 2011-05-13 13:27:43 UTC
Done on trunk in r87976

Note You need to log in before you can comment on or make changes to this bug.