https://bugzilla.wikimedia.org/show_bug.cgi?id=57824

       Web browser: ---
            Bug ID: 57824
           Summary: Display tabs as 4 spaces using CSS tab-size property
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Tabs in code blocks should be rendered as four spaces, instead of the default
eight, using the tab-size CSS3 property.

Shorter tabs make most languages more readable, especially on smaller screens.
Moreover, shortening the tabs would harmonize this feature with the CodeEditor
extension, which displays tabs as four spaces and now binds the Tab key to the
tab character.

The following rule in MediaWiki core would primarily apply to stylesheets and
scripts in the MediaWiki: namespace:

.mw-code {
    -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4;
}

It degrades gracefully in browsers that lack support for the tab-size property.
(See <http://caniuse.com/css3-tabsize>.) Some caveats:

* It doesn't cover Lua modules, because the Scribunto extension doesn't use the
`mw-code` class (it probably should).
* It doesn't match ordinary <pre> blocks. Alternatively, it might make sense to
just select `.mw-code, pre`, and let extensions or individual pages override
the rule if necessary.
* The SyntaxHighlight extension seems to convert tabs to eight actual spaces,
so this rule would have no effect on <source> tags.

See [[Wikipedia:Village pump (technical)#GeSHi tab size]] for more discussion
about this proposal. The Vietnamese Wikipedia has used tab-size for awhile
without complaints.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to