-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable names ending with an apostrophe are not parsed correctly by GeSHi syntax highlighter #8
Comments
Arf! I should have read previous Issues as I just realize this bug was described in Issue #6... Nevertheless it may be a chance because following another lead drove me to realize how verbose is the SyntaxHighlight extension of MediaWiki. Comparing HTML produced by it on Extension:SyntaxHighlight page with the use of Prism library is enlightening. On Usage subtitle here is the Python code example (HTML): <div class="mw-highlight mw-content-ltr" dir="ltr"> Equivalent display with Prism (HTML): Notice how similar is MediaWiki markup (HTML): I don't know how risky it is to update MediaWiki and I don't know if it is possible to hack it to use an external library like Prism but it may be a cheaper fix. |
I think the easiest, lowest-risk approach would be to update to the last version of GeSHi, which has fixed this problem. I will try to look into that soon. Long-term, when #7 is fixed, we'll be using Pygments, which also has fixed this problem. I don't think switching to a third syntax highlighter, other than GeSHi or Pygments, is going to be attractive unless it already has a MediaWiki plug-in, because I'd like to avoid maintaining custom code. I'd rather use MediaWiki "out of the box" as much as possible, because this will make maintenance easier. Meanwhile, I'm going to close this bug, since it is a duplicate of #6, which is still open. |
GeSHi is quite old (last version is date August 2012).
Newer syntax highlighter could improve code readability and correct error mentioned in the title.
As an example, here is how a sample of example 12 in All About Monads looks like now:
And how it could look like with another library, Prism in that case:
It is also worth noting GeSHi is a PHP library while Prism is written in JavaScript.
Prism inclusion in HTML code is very lightweight compared to GeSHi which add formatting
<span>
tags everywhere, as a result HTML pages would be lighter, even with css and js files included.The text was updated successfully, but these errors were encountered: