Last modified: 2013-03-25 15:21:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T12621, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10621 - Add "Switch view" for CSS/JS/Lua pages or user preference for that
Add "Switch view" for CSS/JS/Lua pages or user preference for that
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
1.21.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
https://en.wiktionary.org/wiki/Module...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-17 23:57 UTC by Danny B.
Modified: 2013-03-25 15:21 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Danny B. 2007-07-17 23:57:44 UTC
Recently CSS & JS pages have been blocked from custom rendering and are rendered in monospace font with syntax hiliting. Although syntax hiliting is nice, this hardcoded behavior is not user friendly (besides it can be solved by wrapping the entire page in <pre> or <source>). Bug 10410 and bug 10422 show I'm true.

So I propose different approach to these pages which brings much better user friendliness:

Either

* add switch view pulldown to the header of CSS/JS pages to select regular wiki / pre / syntax hilite style of rendering - a bit similar to Special:Allmessages where you can choose either table or PHP view

Or

* add new preference called "Render CSS/JS pages as:" and the pulldown described above.

Let the user decide which style he likes.

(choose the way which is simplier to implement or suggest other with similat principle - user's ability to choose, I'd prefer user preferences because it will be global behavior setting, or both so user can override global behavior on such page temporarily)

----

PS: Why wikitext, pre and syntax hilight and not only wikitext and syntax hilight? Because syntax hilight produces hell-a-long pages while pre style with same view (monospace font) is much much shorter.
Comment 1 Danny B. 2007-07-18 08:21:35 UTC
Do not close the bugs without saying a reason. Reopened for discussion.
Comment 2 Brion Vibber 2007-07-18 17:57:32 UTC
An extra switch would be undesireable. Please stick to the existing bugs for improving the fixed layout.
Comment 3 Danny B. 2013-02-19 03:35:29 UTC
I just tried to open https://en.wiktionary.org/wiki/Module:languages and my Firefox 18 got frozen so I had to kill it. Big DOM trees are still too difficult for browsers, so I would like to reopen discussion on this topic. I understand that syntax hilight is useful, no doubt about it. But sometimes it can become disruptive, as shown in this case. Optional solution would be to have client (JS) hilighter.
Comment 4 MZMcBride 2013-02-19 03:38:51 UTC
(In reply to comment #3)
> I just tried to open https://en.wiktionary.org/wiki/Module:languages [...]

I can confirm that this 30,000-plus-line monster is causing Google Chrome to lock up as well. The syntax highlighting balloons the size of the HTML to the point that the browser gets overwhelmed.
Comment 5 Danny B. 2013-02-19 03:42:45 UTC
It does not even have to be such monster - you can simply have other stuff consuming your memory in given time - other tabs, other programs etc. so you really don't want to have your browser to explode.

Also think about people with limited internet connections (speed, FUP, price per kB etc...)
Comment 6 MZMcBride 2013-02-19 09:57:12 UTC
https://en.wikipedia.org/wiki/Module:Convertdata is about 7,400 lines and seems fine in my browser. So somewhere between 7,400 and 30,000 lines, the HTML gets too big to be reasonable.

It may make sense to cap syntax highlighting at a certain number of lines (10,000 or so) or change the way in which it works (client-side JS instead of changing the rendered HTML?). The giant pages just don't seem sensible for huge pages with the current implementation when the whole mass of text can presumably just be wrapped in <pre> and load reasonably quickly.

On the other hand, using wiki pages as databases... this is headed down a dangerous road. This isn't code, it's structured data. :-/
Comment 7 Ori Livneh 2013-02-21 22:28:56 UTC
I90c645f9d03bbdc135058a3717a463dec40aa77d (deployed today) disables highlighting of certain token types on very large files, so that aspect at least is resolved.

You can check https://en.wiktionary.org/wiki/Module:languages to confirm.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links