Commit graph

4 commits

Author SHA1 Message Date
John Vandenberg aacd82820b Use 'ebnf' to render 'bnf'
bnf syntax renders correctly using the ebnf handler.

Change-Id: I4f6f96d1b1c034c1f653797d0d03436307ddc819
2015-07-12 21:36:30 +10:00
John Vandenberg 53ea68e8b3 Render "bibtex" as "latex"
bibtex was supported by GeSHi, and is LaTeX syntax.

Change-Id: Id29f61529c5afbc5c9ecf51f81b5cdae7f3b3737
2015-07-12 15:53:04 +10:00
Kunal Mehta 139f68c410 Render "xpp" as "java"
Per jayvdb on wikitech-l, who said it looks "quite good":
 https://lists.wikimedia.org/pipermail/wikitech-l/2015-June/082166.html

Change-Id: I234a4da51592cabddce356c692471e90e6f2a829
2015-06-23 11:29:08 -07:00
Ori Livneh 6484894497 Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.

Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.

To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.

The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.

Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:

    {
        "extra": {
            "merge-plugin": {
                "include": [
                    "extensions/SyntaxHighlight_GeSHi/composer.json"
                ]
            }
        }
    }

Then run `composer update`.

Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-22 23:37:15 +01:00