Commit graph

406 commits

Author SHA1 Message Date
Reedy 5cdceae3c3 Update comments
Add a couple of GPL headers

Change-Id: I55acc3bf4e45ae62e41ffe16f081073111171779
2014-06-15 17:22:00 -07:00
Reedy 13dfba4f9a Rename hook subscriber
Swap global function for closure

Change-Id: I41a17461546ac76e223db1c2dc5b2be1ff093af8
2014-06-16 00:20:08 +00:00
Reedy 33ab38abe5 Rename HighlightGeSHilocal to ResourceLoaderGeSHiLocalModule
Change-Id: I018c1a4ea290ec914f7605d402c297d0c6fe113f
2014-06-01 18:57:10 +01:00
Translation updater bot 7ae613d999 Localisation updates from https://translatewiki.net.
Change-Id: I7f567d0f8b9f987e2dcfc938231f10bde43541d9
2014-05-24 15:23:40 +00:00
Bartosz Dziewoński 44177a6b13 Make sure font size in GeSHi output is not too small
Follow-up to I7bbdcc0a, see it for details.

Also cleared up the comment describing this here.

Bug: 26204
Change-Id: I103a6d5c3e1f91cf74e244756c2ad318e429a78e
2014-05-06 01:50:04 +02:00
Bartosz Dziewoński 79b37aa109 Remove unused backwards-compatibility code
Change-Id: Iffa42d7579d882cd119851a075b6e63f670c02bc
2014-05-05 12:32:56 +02:00
Bartosz Dziewoński b6d8b1a5b9 Use ResourceLoader modules for style loading
We want to be able to track what styles were added to be able to deliver
this information to MediaWiki's live preview functionality (in order
to solve bug 24134).

This required moving some code in SyntaxHighlight_GeSHi class around.

The old way still works and is used for MediaWiki 1.20 and lower.

Bug: 24134
Change-Id: Iafd91de8922be55688fedef4e43a8e7f54d4e1cc
2014-05-04 20:46:21 +02:00
Translation updater bot 49592712fe Update i18n shim
A performance issue was fixed in the shim(s) generated by
generateJsonI18n.php, so it needed to be updated.

Change-Id: I68764e4b5e5a2bff2a433edadf343707f544172f
2014-04-22 13:47:29 +00:00
Translation updater bot 5c3eb066b8 Localisation updates from https://translatewiki.net.
Change-Id: I2f504948ec2352005c7a473d107f0a61526b1425
2014-04-16 15:54:08 +00:00
Translation updater bot 63c98eaaae Localisation updates from https://translatewiki.net.
Change-Id: I3d15d0f0baa9296a1931c9c66c0f2937e9dd330d
2014-04-15 20:11:43 +00:00
Translation updater bot d639f00b51 Localisation updates from https://translatewiki.net.
Change-Id: Ice835c44174f9764da1f14a2c8842acd664ccc84
2014-04-01 19:51:53 +00:00
Siebrand Mazeland 5835d5f052 Migrate to JSON i18n
Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php
with shim.

Change-Id: I28967ff1b8fc990bb5bcc88cd49a73c681dcfc91
2014-03-28 22:39:14 +01:00
Translation updater bot d97a1c340b Localisation updates from https://translatewiki.net.
Change-Id: Id70fbfcac65708f0a68c9b441e38e4862a4e040b
2014-03-28 19:40:05 +00:00
Translation updater bot a946631e15 Localisation updates from https://translatewiki.net.
Change-Id: Ice456dd6992b30aca3452e09ccc60503165e027f
2014-03-27 20:32:21 +00:00
Translation updater bot 69337ceac0 Localisation updates from https://translatewiki.net.
Change-Id: Iefc521355e8e3d748a8e5a806e579995af118e84
2014-02-26 22:03:46 +00:00
Translation updater bot 73a000ea22 Localisation updates from https://translatewiki.net.
Change-Id: I0d2526005c4891b4598bdc14d65219db4fc504f1
2014-02-14 20:21:33 +00:00
Translation updater bot 96540df9d2 Localisation updates from https://translatewiki.net.
Change-Id: I950a9a1e8fc633e020c09b3aaab45e06872b8311
2014-02-01 19:46:36 +00:00
jenkins-bot 6898dfd82e Merge "Remove old username" 2014-01-23 01:32:33 +00:00
Reedy f22a190ce6 Add COPYING
Change-Id: I861c0d58cf2ced32a1cd887186fc2272011af147
2014-01-22 19:44:32 +00:00
helderwiki 69360a1b60 Remove old username
My current user name is already in the list.

Change-Id: Id1e4726857e65f333ebc22e12f3d719ee2859ac2
2014-01-22 15:59:22 -02:00
Translation updater bot 81dc89e9da Localisation updates from https://translatewiki.net.
Change-Id: I246b317a26bbf4490d04b1b5d540fdd24bbd18e5
2014-01-21 19:54:03 +00:00
Translation updater bot c29212de7f Localisation updates from https://translatewiki.net.
Change-Id: Iae3638bef234ceb17f26f4cdb464e830e4890da1
2013-12-28 19:32:35 +00:00
Translation updater bot a4a381877c Localisation updates from https://translatewiki.net.
Change-Id: I37b572a144dfb7deca997b2383d8f5c2b8eff015
2013-12-07 01:52:26 +00:00
Brad Jorsch 335a5e9a9c Protect tabs from HTML Tidy
HTML Tidy doesn't care for tabs, and likes to always output spaces. This
can break the syntax-highlighted output, since Tidy converts tabs to
spaces on the source-code level instead of on the rendered HTML level,
even inside <pre> tags where it really shouldn't (this is probably a bug
in Tidy).

r97300 fixed the bad indenting by converting tabs to spaces before
highlighting, which works around Tidy's bug but breaks highlighting of
languages where tabs are significant (e.g. Whitespace).

It turns out that Tidy's tab mangling occurs while it's reading the
source file, before the conversion of entities such as &#9; to tab. So
GeSHi can armor its <pre>-wrapped output against Tidy's bug by encoding
all tabs as &#9;.

Bug: 30930
Bug: 57826
Change-Id: Id541e2712bd3f94446442ccf2e1e2f214e2801ba
2013-12-02 16:43:36 +00:00
Translation updater bot fd31d07530 Localisation updates from http://translatewiki.net.
Change-Id: Ic3c6b4f62f6bfd0e7d8d78d17ffbc6175653defa
2013-11-02 20:03:21 +00:00
Adamw 2f064f4536 Merge "Haskell syntax: omit single quotes from QUOTEMARKS" 2013-10-24 05:51:03 +00:00
Translation updater bot 7fa4488622 Localisation updates from http://translatewiki.net.
Change-Id: I7841ab7af5e7c2ec280f9f1f9d3894a8d1de4c86
2013-10-21 19:40:33 +00:00
Translation updater bot dff9489b14 Merge "Localisation updates from http://translatewiki.net." 2013-10-15 19:40:43 +00:00
Translation updater bot 4bdf6861a9 Localisation updates from http://translatewiki.net.
Change-Id: I1d973d94b73b0760a0cdd6c12bc7cf574f1035e8
2013-10-15 19:32:38 +00:00
Translation updater bot af8aa7b66b Localisation updates from http://translatewiki.net.
Change-Id: I3147b110244f3854c01abdd49291880f4c3c1e21
2013-10-14 09:31:14 +00:00
Ori Livneh b4b8ff670f Haskell syntax: omit single quotes from QUOTEMARKS
Single quotes in Haskell may be used to delimit character literals, but they
can also be used in identifiers. GeSHi's syntax highlighter only recognizes the
former usage. When Haskell source uses "'" as part of an identifier, GeSHi
treats it as the start of a literal string, which screws up syntax
highlighting.

Upstream bug report and proposed patch have been ignored for more than a year,
so I am applying the proposed fix here, and changing the version identifier to
reflect a WMF modification.

Upstream bug report: <http://sourceforge.net/p/geshi/bugs/217/>
Upstream proposed patch: <http://sourceforge.net/p/geshi/bugs/219/>

Bug: 52509
Change-Id: I210832c4b272b5c03bbc4623d73fb821092e5ef4
2013-10-09 02:48:51 -07:00
Bryan Petty cd001a9ed9 Add Option to Enable Keyword Links
Patch by Bryan Petty

Bug: 53787
Change-Id: I8c818859df8240cfcfef94d06d5d12a848cc76dc
2013-10-09 09:03:03 +00:00
Translation updater bot 32f2019420 Localisation updates from http://translatewiki.net.
Change-Id: I512afaf3fc61d85c8eb3cec7ca4108cffc1c0aa9
2013-10-02 19:54:50 +00:00
Translation updater bot 0c59695854 Localisation updates from http://translatewiki.net.
Change-Id: Icab1dac6c13146d6198cb0345a618cf23e4184d2
2013-08-25 13:30:15 +00:00
Translation updater bot 7dc28cee7b Localisation updates from http://translatewiki.net.
Change-Id: I50420a7ed85872ba072fffca85b02f642a727780
2013-08-18 19:41:49 +00:00
Translation updater bot 6e0fd771f4 Localisation updates from http://translatewiki.net.
Change-Id: I8727666c874f1a0393353a58fc4d68a6840fea72
2013-07-09 20:40:01 +00:00
Reedy 67b740dff6 Remove contrib directory and add gitignore to ignore it
Change-Id: I0a4bcfb54abe9d98b37d87912ee23ec17cea11ac
2013-06-15 16:36:49 +01:00
Translation updater bot 3114635614 Localisation updates from http://translatewiki.net.
Change-Id: Ied5c30b5659c25f8effba18035c81cf800b3bd85
2013-06-03 19:06:37 +00:00
Translation updater bot 610d1789bd Localisation updates from http://translatewiki.net.
Change-Id: I2f469034d0a51f97cdd2e5a4f1183c814d484f18
2013-05-10 19:56:03 +00:00
Translation updater bot 52200f561f Localisation updates from http://translatewiki.net.
Change-Id: Ia73796f6c61e4a4f86a7dbc2ce5f7ce4c7fb3241
2013-04-28 23:58:01 +00:00
Brad Jorsch f21f048443 (bug 45669) Fix highly recursive number highlighting regex
The regular expression used for number highlighting in GeSHi is highly
recursive, and easily overflows the low PCRE recursion limit on WMF
sites (and, on sites where the recursion limit isn't low, it can easily
crash PHP).

Fortunately, it's easy to fix for the common case.

This is also reported upstream at
https://sourceforge.net/p/geshi/bugs/223/

Bug: 45669
Bug: 36839
Change-Id: I27203c767d1d3f2f0999b1b1d8a06e8cf68c19ed
2013-04-09 11:58:55 -04:00
Translation updater bot 1ef3593547 Localisation updates from http://translatewiki.net.
Change-Id: I839107fd43dc0d88c2eff924007e5ecfaaeca816
2013-04-05 22:29:16 +00:00
Dereckson f976a48f37 (bug 44214) Fix bundled GeSHi library inclusion path
Currently, the SyntaxHighlight GeSHi extension includes geshi/geshi.php.

This creates a conflict when an up to date GeSHI library exists in PHP included path.

This change let the SyntaxHighlight GeSHi include our bundled version instead.

Change-Id: Ie8f9aa6182a38508201d639723e876c156d8b0d1
2013-03-06 03:40:00 +00:00
Reedy 256bd6f090 Disable Ie260c22680ec9a
Comment out new hook rather than a blanket revert

Change-Id: I58b2e0b9f485ac5bf3c38776f8d5981644ebe360
2013-03-05 20:01:08 +00:00
daniel 064fb261db Use new ContentGetParserOutput hook.
Using ContentGetParserOutput instead of ShowRawCssJs allows highliting to be applied
for other kinds of scripts as well (e.g. Lua). It also allows more special case code
for CSS and JS to be phased out.

NOTE: this requires Ibfb2cbef to be merged in core!

Change-Id: Ie260c22680ec9a31e505c685d70e17efe8a7bf44
2013-03-05 19:52:04 +00:00
Ori.livneh 0122c20452 Merge "(bug 26204) font-size is too small" 2013-02-22 23:41:19 +00:00
Ori Livneh 9fd1639d46 Disable some highlighting for MOUSs
(...modules of unusual size.)

Enabling full syntax highlighting for very long Lua modules can produce DOMs
that have hundreds of thousands of elements and cause browsers to lock up.

I took a count of spans by class (which amounts to a count of tokens by type)
of https://en.wiktionary.org/wiki/Module:languages and came up with:

       sy0:      62545 (symbols)
       br0:      61952 (brackets)
       st0:      39291 (strings)
       kw3:       7746 (keywords)
       kw1:          3
       kw2:          2
       co2:          2
       co1:          2
       nu0:          1
     ------     ------
     Total:     171544

GeSHi allows you to disable highlighting for a particular token type (see
<http://qbnz.com/highlighter/geshi-doc.html#disabling-lexics>) which like a
good way of handling this issue.

Disabling symbols (set_symbols_highlighting(false)) removes both sy0 and br0
elements from the DOM (about 124k elements in the case of Module:languages),
with about 47k elements remaining on the page. This is enough to make Chromium
responsive on my laptop (2.3ghz i5, 8 GB RAM), but it's still noticeably
sluggish. Adding 'set_string_highlighting(false);' removes another 40k elements
from the rendered output, and the resulting DOM is quite zippy at 8k elements.

Proposed solution: disable symbols highlighting when >100 kB; disable strings
highlighting too when >200 kB.

Change-Id: I90c645f9d03bbdc135058a3717a463dec40aa77d
2013-02-20 22:06:59 -08:00
Antoine Musso 6d54985ad6 (bug 26204) font-size is too small
The Geshi rendered output has a font-size of 10px where we would expect
13px just like for <pre>.

Bug 33496 against MediaWiki core dealt with that issue already: in some
(all?) browser 'monospace' has a size of 13px where as the default is
16px. When defining a font-size of 0.8em the monospace is scaled down to
10 px which is too small. By appending another font statement, the
browser treat monospace as a default font and thus scale it starting
with 16px instead of 13px.

This patch append a style to geshi which set the font-family to
"monospace, monospace" thus tricking the browser in considering
monospace a regular font.

Change-Id: I7bbdcc0a21010513473a7ca9d784df77e9920b5b
2013-02-13 22:37:00 +01:00
Translation updater bot f583c1186d Localisation updates from http://translatewiki.net.
Change-Id: I4842fd9e5a9533ee58cdb3a58aed33e643cca198
2013-01-27 17:55:33 +00:00
Translation updater bot cde3789e52 Localisation updates from http://translatewiki.net.
Change-Id: Iaee6a426fa052669baf0b7b340ca9515f081237e
2013-01-19 16:13:35 +00:00