Commit graph

32 commits

Author SHA1 Message Date
Ed Sanders fe357519c7 Add correct classes to full page output
Previously the full page output was missing the
-lang-<languagename> and mw-content-<dir> classes.

Change-Id: I54f4ed0a86e78a3a7ff1d670ebbdfdb6f05f86cc
2020-12-30 20:31:38 +00:00
Ed Sanders 6e558b37db Add small gap between line numbers and code
Change-Id: Ie65128872f318a42677e52420338684ad8d814f8
2020-12-30 19:43:03 +00:00
Freephile 24d418bced The word Python was misspelled
Change-Id: Icb38cd1cc07d2a2be95cdf3254502af0417afdf8
2020-10-07 17:30:05 +00:00
Reedy 0f876f17b1 Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: Ibbf708a030504b1db61050cd2ef05280e9d52f2d
2020-09-19 12:11:07 +01:00
jenkins-bot 3bc07c4dfa Merge "Pass associative array to Sanitizer::validateAttributes" 2020-06-12 02:44:29 +00:00
C. Scott Ananian c281e5f423 Pass associative array to Sanitizer::validateAttributes
Bug: T255049
Change-Id: I68f122d5a3fa06b0434863cff73851a39dd10514
2020-06-10 14:01:21 -04:00
Reedy 16243d424f Also remove GeSHi class
I think two years is more than long enough for this one too

Change-Id: I6dd34c3fd60d6ade0206bc3d62759d87359c0b7a
2020-04-19 00:52:50 +01:00
Reedy 2d2119801a Kill SyntaxHighlight_GeSHi alias
I think 3 years is more than long enough

Change-Id: I03563e45be48f03622cbeda09a20b2f6ffe2b998
2020-04-19 00:48:44 +01:00
DannyS712 f5b61126da Add tracking categories when deprecated syntax is used
When the `enclose` attribute is used `syntaxhighlight-enclose-category`
is added, and when a <source> tag is used, the
`syntaxhighlight-source-category` is used.

Parser tests verify the tracking category is added when appropriate.

Bug: T241636
Bug: T237267
Change-Id: I7a21c635de426ab024703c04acdc6fa2184daedb
2020-04-09 19:18:32 +00:00
Umherirrender b59f43ce8e Improve param docs
Change-Id: Ifcb9ed2fbbdc38e11dfcc44951314baed81f2410
2020-02-29 22:17:22 +01:00
Derk-Jan Hartman c1e371b8e6 Syntaxhighlight: Classnames for the highlighted language
Bug: T189106
Change-Id: If7f678bd875dcfe581cd08a04b998970ed28d6d2
2020-02-18 20:13:53 +01:00
libraryupgrader 4f7ed16f87 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingReturn

Change-Id: I6576c262bf717aa9b3b0577caa27c05cff0cb44b
2020-01-14 12:44:57 +00:00
libraryupgrader 0916348c84 build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: Id77528732abaa59ab1e2610c2acc87cb2858b8cd
2020-01-10 10:49:20 -08:00
jenkins-bot 4ba73a94a5 Merge "Remove 2 unused functions deprecated 5 years ago" 2019-11-18 10:34:45 +00:00
Max Semenik b591e2cdab Remove 2 unused functions deprecated 5 years ago
Change-Id: I8dc549f3c681616a8331c0666c60972db9ff41bf
2019-11-14 21:47:18 -08:00
Max Semenik 310de5114f Stop passing objects by reference
Bug: T193950
Change-Id: I968b53ebd6ab2780c952511469cb73856f354e1a
2019-11-14 21:41:37 -08:00
James D. Forrester 1087f347e6 Drop use of wgParser, replaced in 1.32 and to be removed in 1.35
Bug: T160811
Change-Id: I7c40256638c4bd17d8baf568685a794147cbeabc
2019-10-28 20:13:31 +00:00
Derick Alangi 2f0a6a0c9a Avoid usage of deprecated ObjectCache::getMainWANInstance()
Replacement with services made available in 1.28 and this extension
requires (1.33). So, the replacement is good.

Change-Id: I12bb8496ff0aa518acc6f5b4c023cb075db8e64b
2019-07-03 14:59:01 +01:00
libraryupgrader 207172de43 build: Updating mediawiki/mediawiki-phan-config to 0.5.0
Change-Id: If6f3dd1c6c4cec6880c196d29278feba6e3169d9
2019-03-10 22:30:03 -07:00
Timo Tijhof 10d0a248bf Override supportsURLLoading() instead of getScriptURLsForDebug()
This is more semantically correct and avoid duplicating the
url logic in an extension.

This was the only FileModule subclasses I found that overrode
getScriptURLsForDebug for this purpose.

Change-Id: Id940067437be190760559ec452583347c6b94901
2018-11-28 00:57:37 +00:00
Thalia 118dcdb405 Separate node classes into individual files
Bug: T205231
Change-Id: Id175f839f0ac8714c44407c52145d4140cd8e343
2018-09-24 18:48:22 +01:00
Kunal Mehta ab5ce23881 Remove tidy workaround for armoring tabs
RemexHtml does not mangle tabs, so we don't need to armor them! We'll
now output literal tab characters, so this does change the HTML output,
but does not have any visual change.

Depends-On: Idf246d05d116f63a73105b50a1929a7721fbe7b9
Change-Id: I2ba871acf9ff5fdc81c13e03eee3a8fe670e1f0f
2018-09-18 21:30:20 +00:00
C. Scott Ananian 14e3167406 Use MWTidy::isEnabled() instead of deprecated $wgUseTidy
The $wgUseTidy global has been soft-deprecated since MW 1.26, which is
when MWTidy::isEnabled() was added.  This extension currently requires
MediaWiki >= 1.32 according to extension.json.

Change-Id: Ie30c9174e6e3b60bce5a692296a9de1e30192e2c
2018-09-07 17:12:45 -04:00
libraryupgrader 74dbf4bba9 build: Updating mediawiki/mediawiki-codesniffer to 22.0.0
Change-Id: I1c75e007be52cd22d0a72d228e56a3a9683fbb58
2018-09-03 19:50:49 +00:00
Kunal Mehta 27b6687848 Use wfMakeStaticArrayFile()
wfMakeStaticArrayFile() expects an associative array, so let's take this
opportunity to turn the lexer list into one with true as the value. This
allows us to use isset() instead of the slower in_array() when checking
to see if a lexer is known.

Bug: T200626
Change-Id: I7a852ddbcfa7c8ed19ac933205cabd176b20d0cb
2018-07-28 21:29:57 -07:00
Gergő Tisza cc44c3c7a8 Add notice about resource loading to highlight()
Co-Authored-By: Timo Tijhof <krinklemail@gmail.com>
Change-Id: Ide7ab4b84d1aacad2db8400de9e350a09c80e8c0
2018-05-01 09:17:58 +00:00
Ed Sanders af1a91ade9 Use OOUI 'markup' icon instead of VE's deprecated 'alienextension'
Change-Id: Iad1882c20c17792c1339cf9922b9c4c43bf6122b
2018-03-20 19:00:41 +00:00
Timo Tijhof 8c3a3ffda0 Update highlight() to use getWithSetCallback() idiom
* Use backend-specific makeGlobalKey() method instead of
  deprecated wfGlobalCacheKey().

* Call makeCacheKey() inline and reduce to only producing
  part of the key (makeCacheKeyHash).

* Add a $ttl (1 month), instead of the previously unspecified
  expiry (default: indefinite).

Change-Id: I913a768a3b61cc31ce14fa086a563ceecca7c603
2018-02-22 23:53:56 +00:00
Timo Tijhof ae9b8419dc Factor out plainCodeWrap to avoid recursive call to self
The recursive call is somewhat counter-intuitive, and seems like it could
easily break if forgotten. Instead, move the part that we want to re-use
out into its own method.

Change-Id: I64ced0da211155299744d3c86f7818e751ad027e
2018-02-22 23:40:19 +00:00
Timo Tijhof 92602f33da Minor clean up
* Move "empty tag" case to earlier in highlight() by comparing to
  empty string without strlen(). Follows-up cda15b184.

* Turn "shell disabled" case into 'elseif' after length check,
  instead of subsequent 'if'. That way, in case of a too large
  string, we don't need to check if shell is disabled, and it
  also provides the user with the size-related error instead of
  the shell-related one.

* Add a few clarifying code comments.

Change-Id: Ib0ef9e683ac4aadd0461fe061ddbe9bfb0a27a82
2018-02-22 23:40:07 +00: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 141455aa33 Move classes into includes/
Change-Id: Ie26b5be1bb2551ed339fdb4a587a89823c609b2e
2018-02-15 14:29:07 -08:00