Commit graph

16 commits

Author SHA1 Message Date
Brad Jorsch 41466e274b Update parser test for core change
I42e747f1 stopped changing a regular space before percent-escapes (like
"%25") to a non-breaking space in certain cases, causing tests to fail
where they were expecting that non-breaking space. Update the test to
match this new behavior.

Bug: T199647
Change-Id: If5d90e5701f240b1bc71a3c3458e952e0e2c7df4
2018-07-16 09:23:25 -04:00
Kunal Mehta 1755781a3c Don't manually suppress PhanDeprecatedClass
Already disabled by default in mediawiki-phan-config 0.3.0.

Change-Id: I2ad9dbefd6c167429100070b834fcbdbb216008f
2018-06-08 13:44:56 -07:00
Jayprakash12345 a79bf7638c Update extensions to take advantage of parser test autodiscovery
Bug: T170037
Change-Id: I99e68197bbe0438c7a5a55815e8000f4deb49234
2018-04-13 15:25:52 +00:00
Kunal Mehta 0615fe8444 build: Updating mediawiki/mediawiki-phan-config to 0.2.0
Change-Id: I1e5dc6d8fd131db8dd3296337ee73ae07b42f931
2018-04-05 17:23:15 -07:00
James D. Forrester df6eec698e Parser tests: Update for breaking whitespace change in MediaWiki core
Changed as part of T157418.

Change-Id: I2b71eed948fe211389fb3ac166f04cd39d118328
2018-03-20 11:43:33 -07:00
Kunal Mehta 14d34dfe56 Update parser tests for RemexHtml as tidy implementation
Bug: T188167
Depends-On: Ic7c34d57a300dbd36a37f03fbfe33391b2950b44
Change-Id: I807a99dc9c873f3e6eb67fd62574f7916530d62e
2018-02-23 22:31:41 -08:00
Kunal Mehta cda15b184c If there is no input, don't try and shell out to pygments
pygments will just wait for stdin if the stdin that was passed
to it was empty.

Bug: T188019
Change-Id: I46271f31df74822bc71b3ac283fa572f2d149d67
2018-02-22 13:29:58 -08:00
Kunal Mehta e75fda881e Migrate to mediawiki-phan-config
Change-Id: I038c599b428683cee669e69e9a5106f178b129a2
2018-02-15 14:29:11 -08:00
Rafid Aslam 46700b5fdb Add phan configuration for static analysis and fix phan warnings
Add phan configuration for static analysis, and fix phan warnings.
`PhanDeprecatedClass` and `PhanDeprecatedFunction` rules are supressed.

Bug: T179554
Change-Id: I7cbb410ed88ba58198d0557cafd9e6df968ed885
2017-12-25 11:16:49 +07:00
Kunal Mehta db681d158b Update pygments to 2.2
Notable changes:

* Added new token types and lexing for magic methods and variables in
  Python and PHP.
* Added a new token type for heredoc (and similar) string delimiters and
  lexing for them in C++, Perl, PHP, Postgresql and Ruby lexers.
* Improved the CSS lexer.
* Added Varnish config lexer

Full changelog is found at:
<bc45808f83/CHANGES>

Bug: T156573
Change-Id: I4dc1782f19881ba1294308e1cdea1b2e063f438a
2017-04-27 15:10:16 +02:00
Brian Wolff 8714354068 SECURITY: Replace strip markers before syntax highlighting
The raw strip markers can't be syntax highlighted properly anyhow.

Bug: T51256, T110143, T78456
Change-Id: I822fa2bbfde790df22c00bb87819c9027fb5dcc9
2016-05-20 10:21:06 -07:00
Brian Wolff f85be74e33 Fix parser tests for core commit ee4d5c6eed (removal $wgWellFormedXML)
Change-Id: Iac351ced0154c0c3c61f47a0e8ef0b9166fc0811
2016-05-16 06:02:39 -04:00
Timo Tijhof 206f0fd585 Fix "MWException: Unexpected output from Pygments" in highlight fallback
Follows-up 043969f84e.

This caused a fatal MWException when saving/reading pages that contain a
<source> that couldn't be highlighted (e.g. no lang attribute, unknown
lang, or too large).

Specifically when wgWellFormedXml=false, in which case $out isn't
just from Pygments, but actually from our own Html::element.

Change-Id: Ib299a274d28021b2c7bba52d763dd1e17c1f09ec
2015-07-07 22:12:53 +01:00
Bartosz Dziewoński 043969f84e Refactor final output formatting
* Use 'nowiki' strip marker to prevent list processing (also known as
  doBlockLevels()). This resolves various issues related to using
  <syntaxhighlight/> blocks in lists and lists suddenly appearing
  inside <syntaxhighlight/> blocks. Fixes T17333, T25674, T104067.

* To prevent <p/>-wrapping resulting from the above, add our own
  wrapper <div/> around the output.

* Since we already have our own wrapper, remove Pygments' one and
  extend it with custom attributes. This resolves some regressions
  from the GeSHi migration. Fixes most of T103964.

Bug: T17333
Bug: T25674
Bug: T103964
Bug: T104067
Change-Id: I3afd1224a18549c62cd4a95fd046affa6d1d3b3f
2015-07-05 22:03:24 +00:00
Timo Tijhof e033d2db9e Add parser tests for block and inline behaviour
Change-Id: I0af26e8b86f2f9060bd88db6d36449d983978f09
2015-06-25 05:46:42 +01:00
Kunal Mehta fb0e430f47 Add basic parser tests for functionality of non-recognized languages
Change-Id: I07cecb588818fd4abb0b1b8e8de893cf6f72014a
2015-06-22 22:26:22 -07:00