Commit graph

1110 commits

Author SHA1 Message Date
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
Translation updater bot 8471d548df Localisation updates from http://translatewiki.net.
Change-Id: I9b79bee6bfc1195c3b996febf70456420870310a
2013-01-01 20:26:13 +00:00
Translation updater bot 8053c8a6dd Localisation updates from http://translatewiki.net.
Change-Id: I8e2a4028fc374e90fc93b6f7d625f5f7978f9c04
2012-12-21 20:17:06 +00:00
Translation updater bot cf72ad3467 Localisation updates from http://translatewiki.net.
Change-Id: Ie5f4085134462776dbd3d3bad26d2be2d425b50b
2012-11-11 21:01:13 +00:00
Translation updater bot 8c017a6874 Localisation updates from http://translatewiki.net.
Change-Id: Ie52aa7ad5a3d2a02b388977cdc44a333a4e07ae3
2012-10-22 01:50:01 +00:00
Translation updater bot 9ed234f1f8 Localisation updates from http://translatewiki.net.
Change-Id: Ic203174db3c5bc2a87c5e1ad54955110e9bfc3af
2012-10-02 14:00:53 +00:00
Translation updater bot ea95d133ca Localisation updates from http://translatewiki.net.
Change-Id: Ide70fcd0cf42b748ae36144d7b9c2db3fffcc7db
2012-09-15 19:54:05 +00:00
Translation updater bot 52d1bcad40 Localisation updates from http://translatewiki.net.
Change-Id: I33305c2ca0aceab8c2f5114e50cc687a170f35a5
2012-09-13 20:46:27 +00:00
Reedy da9b414aa7 So, I thought we were already on 1.8.11.....
Change-Id: Ic166d23a78d9bd8e3d0fdc5017da4aabf28dbca9
2012-09-06 01:29:53 +01:00
Derk-Jan Hartman 8d8fb22ebb (bug 39643) Allow "0" as the content of <syntaxhighlight>
The empty() function considers "0" to be empty. Makes empty() useless
for strings.

Change-Id: I798b4bb8e56951128b8f4375749d1418e2ed3b01
2012-09-04 09:51:54 +00:00
Translation updater bot d4f859df52 Localisation updates from http://translatewiki.net.
Change-Id: I7649f55347339473e3452a816cf53e60d41348f3
2012-09-01 20:47:22 +00:00
Siebrand Mazeland c602c5a4a7 Maintenance for extension SyntaxHighlight_GeSHi.
* Use Message class where possible.
* Removed superflous newlines.
* Update .gitignore.

Change-Id: Ic2386183e240662331656ebadcaad1057569fb7c
2012-08-26 11:24:29 +02:00
Reedy 2008cd18a0 Merge "Remove duplicate array key." 2012-08-20 22:12:32 +00:00
Siebrand Mazeland 4e338afca2 Remove duplicate array key.
Change-Id: I1104dbbd18a296bfa2086e12e285835237906c36
2012-08-20 16:38:33 +02:00
Reedy 86281097a1 Merge "Update geshi to the just-released GeSHi-1.0.8.11" 2012-08-20 13:02:43 +00:00
Platonides e942587f3d Update geshi to the just-released GeSHi-1.0.8.11
The two local changes to the geshi code (3d3b8186 and 95d437ca)
are already upstream.

Change-Id: I3164b060229348becfe4a3a3ff94ed5d83d7b696
2012-08-20 00:23:54 +02:00
Translation updater bot 821a80f057 Localisation updates from http://translatewiki.net.
Change-Id: Ia04bacd171a74e5fd33d2d9111d7abd987c195cc
2012-08-17 13:10:50 +00:00
Translation updater bot 88c93b51ee Localisation updates from http://translatewiki.net.
Change-Id: I272ec42b4a637ceb9396f8848c6c4c5c8b086bb8
2012-08-14 19:44:17 +00:00
Translation updater bot a95dcd885b Localisation updates from http://translatewiki.net.
Change-Id: I441fdf8a473a789f3c39b779604449de272cf314
2012-08-11 19:25:49 +00:00
Translation updater bot 561cabfcdb Localisation updates from http://translatewiki.net.
Change-Id: I9f04b0d8047ce73ddcce7a52f9d0b0b874127de2
2012-08-09 19:34:18 +00:00
Translation updater bot a51da3df57 Localisation updates from http://translatewiki.net.
Change-Id: I950b6168b8d6baf53eaa5edd106665651cde0278
2012-07-23 13:46:58 +00:00
Catrope a62433879b Shut up a PHP notice when the (css|js) expression doesn't match anything
This can happen if the TitleIsCssOrJsPage hook causes a page without a
.css or .js extension to be considered a CSS/JS page.

Change-Id: I875a7f89f683336f18e70358fe589cef706fd5d1
2012-07-18 16:33:04 -07:00
Translation updater bot dd1656c9f0 Localisation updates from http://translatewiki.net.
Change-Id: I8e1e0400bd1b957644a8bd14bd4ca5495ad1e2fb
2012-07-11 07:24:38 +00:00
Tim Starling 95d437ca0a Fix highlighting of Lua long strings
The \1 was interpreted as a PHP escape sequence, not a backreference.

Change-Id: Ia1c46d09c2f0dd053f89ee9d443259cd2dd9803f
2012-07-09 14:02:09 +10:00
Translation updater bot ea843bfd5c Localisation updates from http://translatewiki.net.
Change-Id: I4d37b21bded8dee4088b583ab18c7ba3f107ece3
2012-07-01 14:21:32 +00:00
Translation updater bot fc99ed2ad5 Localisation updates from http://translatewiki.net.
Change-Id: I401b0c2fc9bacc9da03be47c9b39c56f360f6852
2012-06-26 20:49:59 +00:00
Translation updater bot aab63e709b Localisation updates from http://translatewiki.net.
Change-Id: I20642c86123bb2b4b0b70ffaeb9030ecae4d3f0e
2012-06-17 20:34:09 +00:00
Translation updater bot ce38cf1bbf Localisation updates from http://translatewiki.net.
Change-Id: Ie61b2dc17cb5ab485702c3fb75befaf9d63ce561
2012-06-14 20:04:47 +00:00
Dereckson 3d3b81862d (bug 37044) Fixed HTML5 syntax highlight typo
Change-Id: I34d0a19da86ddd8644e0cd3b432154161f7d55ae
2012-06-05 19:01:27 +02:00
Reedy f761411c20 Add .gitignore
Change-Id: I3369e8d13b36314dacfbe9793e30e8b5450ccfee
2012-05-21 01:48:34 +01:00
Translation updater bot 51a3768e79 Localisation updates from http://translatewiki.net.
Change-Id: I43f201e984092020e0555ae430cfb1c0d3511117
2012-05-20 19:51:49 +00:00
Timo Tijhof 794ea4d549 Merge "Remove usage of mw-code-inline" 2012-05-14 22:55:10 +00:00
Translation updater bot f7617c9738 Localisation updates from http://translatewiki.net.
Change-Id: I3eb46cbccdb84e3f84724d83834f26b26c435451
2012-05-12 17:55:25 +00:00
Timo Tijhof b06fbd3b60 Remove usage of mw-code-inline
Remove usage of mw-code-inline:
 * That class ended up not being merged into core, so it does nothing.
   Only mw-code (for the <pre> wrap) is needed.
   7c9b2273c9cbdae90c9f4e3890a13619f769c5d0 (mediawiki/core) had both
   in an earlier patch version, but only mw-code was merged.

Follows-up:
 * mediawiki/extensions/SyntaxHighlight_GeSHi:
   dc147a5ef1
   Use .mw-code and .mw-code-inline

 * mediawiki/core
   7c9b2273c9cbdae90c9f4e3890a13619f769c5d0
   Add .mw-code styles in core

Change-Id: I793c05c3e103209cf966d9e35ab37c05528cdbb8
2012-05-11 04:36:18 +02:00
Translation updater bot 478202f1a4 Localisation updates from http://translatewiki.net.
Change-Id: Ia028680696a468c23d2249d460d459992c4cd2c8
2012-05-01 18:39:38 +00:00
Timo Tijhof dc147a5ef1 Use CSS classes .mw-code and .mw-code-inline
- Follows-up I4ff5d0197ba8dc0dad3cafd03f2b120bc22e75cb

- Reverts r113190 (redundant fix that caused 35875)

- Fixes:
 * bug 19416
 * bug 35875

Change-Id: Iaa2227348ca632d4a261c149bdf2428b4b48adc7
2012-04-14 06:08:20 +02:00
Reedy 43764e342c Rather than messing about git-svn or something, just bringing a copy of https://geshi.svn.sourceforge.net/svnroot/geshi/tags/RELEASE_1_0_8_10/geshi-1.0.X/src into svn
Saves people having to do their own checkouts etc, and it can work out of the download from ExtensionDistributor

Change-Id: I934217b5b85c7c0da42051ce36e53ec7288035a5
2012-04-02 18:31:25 +01:00
Peter Gehres 4a0ad13d94 Adding .gitreview
Change-Id: I163b861668b84b7beaafecec2e6cc74942d0bdc3
2012-03-23 10:35:01 -07:00
Sam Reed d2f784ca96 Documentation, spaces, braces, explicit member variables 2012-03-09 23:33:42 +00:00
Krinkle 5dfa1034c1 [SyntaxHighlight GeSHi] Use <code> and <pre> instead of <span> and <div> to allow skins to universally style these without requiring local wikis to manually maintain a copy of each skins's <pre> style and apply it to .mw-geshi
* Fixes
-- (bug 19416) GeSHi-generated blocks should use <pre> style for the container
2012-03-06 22:35:40 +00:00
Robin Pepermans b81f422ffc Add mw-content-ltr/rtl class: fixes bug 33538: Line numbers are outside of left border when using <source ... line start= > on RTL wikis
Also make sure mw-content-ltr/rtl is the same as the dir attribute value. Restrict that value to either ltr or rtl (not sure if rtl really needed; source code is always ltr). Also remove text-align:left; as it can/should be set manually in the <source> tag.
2012-01-05 19:46:42 +00:00
Raimond Spekking beba10969a Localisation updates for core and extension messages from translatewiki.net 2012-01-04 21:00:47 +00:00
Raimond Spekking bf761c0a63 Localisation updates for core and extension messages from translatewiki.net 2012-01-02 20:46:12 +00:00
Raimond Spekking cf0356e67d Localisation updates for core and extension messages from translatewiki.net 2012-01-01 20:29:00 +00:00
Siebrand Mazeland fe2d26eb66 Rename no to nb (step 4/4): Change 'no' to 'nb' in remaining files. 2011-12-25 09:42:00 +00:00
Sam Reed 65ffff273a Fix whitespace
Don't use direct member variable access
2011-12-16 14:51:31 +00:00
Raimond Spekking 7010edd328 Localisation updates for core and extension messages from translatewiki.net 2011-12-15 20:19:43 +00:00