Commit graph

5 commits

Author SHA1 Message Date
Ori Livneh f89bc8d62c Drop dependency on kzykhys/pygments
kzykhys/pygments provides very little added value when compared to just using
symfony/process directly. Since kzykhys/pygments appears to be unmaintained and
is currently broken, depend on symfony/process directly instead.

Change-Id: I34c7e4201c2c21d3f8607ec826a4c9869e2da917
Task: T120068
2015-12-04 15:02:13 -08:00
Kunal Mehta c3a69e1ffe build: Updating development dependencies
* mediawiki/mediawiki-codesniffer: 0.4.0 → 0.5.0

Change-Id: If179bcf09f139c97c22a9bcab95e33ed6c9ffe66
2015-10-23 15:33:06 -07:00
paladox 96806a8f39 Update mediawiki-codesniffer and parallel-lint settings
Change-Id: I34446a973c2e07add2d0e573e9dfec6fb49d60a9
2015-09-29 01:45:26 +02:00
paladox ee3896a51c Add php code sniffer to SyntaxHighlight_GeSHi
Requires https://gerrit.wikimedia.org/r/#/c/225035/

Change-Id: If46b56fa8aa26b03890274ac772110eba9519f8d
2015-09-27 21:16:58 +02: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