Page MenuHomePhabricator

Change `tab-size` from browser default `8` to `4` in SyntaxHighlight
Closed, ResolvedPublic

Description

Chrome/Opera, Firefox and Safari all already have support for CSS property tab-size. We should apply a lower value than browser's default 8 (spaces) to <syntaxhighlight> blocks to make our documentation more easily digestible.


Block on the left has tab-size: 4 set, block on the right is browser's default.

Details

Related Gerrit Patches:
mediawiki/extensions/SyntaxHighlight_GeSHi : masterFollow-up Ib709ffd72: Add vendor prefixes
mediawiki/extensions/SyntaxHighlight_GeSHi : masterSet tab size to 4

Event Timeline

Volker_E created this task.Oct 12 2015, 9:50 PM
Volker_E raised the priority of this task from to Needs Triage.
Volker_E updated the task description. (Show Details)
Volker_E added a project: SyntaxHighlight.
Volker_E added subscribers: Volker_E, Krenair, brion, Krinkle.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 12 2015, 9:50 PM
Volker_E updated the task description. (Show Details)Oct 12 2015, 9:53 PM
Volker_E set Security to None.

Change 247569 had a related patch set uploaded (by Esanders):
Set tab size to 4

https://gerrit.wikimedia.org/r/247569

Change 247569 merged by jenkins-bot:
Set tab size to 4

https://gerrit.wikimedia.org/r/247569

Jdforrester-WMF closed this task as Resolved.Oct 22 2015, 3:34 PM
Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF triaged this task as Medium priority.

Hmm - this could actually be problematic. I imagine there are cases where people are lining up stuff up using tabs instead of spaces, e.g.

foobar { baz
         quux
         whee }

using

foobar<tab>.{.baz
<tab       >..quux
<tab       >..whee.}

While I'm less concerned about people having to migrate to tab-size 4, the problem is that the feature is CSS3 and not supported in any version of IE/Edge which could lead to edit wars...

Change 249371 had a related patch set uploaded (by Esanders):
Follow-up Ib709ffd72: Add vendor prefixes

https://gerrit.wikimedia.org/r/249371

Change 249371 merged by jenkins-bot:
Follow-up Ib709ffd72: Add vendor prefixes

https://gerrit.wikimedia.org/r/249371

@Esanders This could probably be a side effect, but we agree that it improves code readability, exemplified at https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP and we therefore give it a shot?