Page MenuHomePhabricator

Default whitespace for headings should include spaces before/after ==
Closed, ResolvedPublic

Description

As a follow-up to bug 49428 and bug 50771, default whitespace for headings should includespaces before/after ==.

Or in other words: prefer "== Heading ==" to "==Heading==".

(While this might seem minor, the first style was enforced at pl.wp with automated tools since ever and editors gets annoyed when VE changes it. Reported at https://pl.wikipedia.org/wiki/Wikipedia:VisualEditor/Opinie#sprz.C4.85tanie_kodu )


Version: unspecified
Severity: enhancement

Details

Reference
bz51744

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:54 AM
bzimport set Reference to bz51744.

It would be very helpful if you can provide a list of any other default whitespace rules for other wikitext elements. It is simpler to implement this in one shot rather than piecemeal.

Right now, we cannot implement different rules for different wikipedias, but, if necessary, something that we could consider at a later point. So, can you also include some information, if you have, about whether the style rules are universal or specific to pl.wp?

(In reply to comment #1)

It would be very helpful if you can provide a list of any other default
whitespace rules for other wikitext elements. It is simpler to implement
this
in one shot rather than piecemeal.

Sorry, I post these when I notice Parsoid is doing things not in my way :)

Right now, we cannot implement different rules for different wikipedias, but,
if necessary, something that we could consider at a later point. So, can you
also include some information, if you have, about whether the style rules are
universal or specific to pl.wp?

Yeah, of course. No idea if any other wikis use any similar cleanup tools as pl.wp, but in general more whitespace is more readable than less (wikitext is just like code in this regard :) ).

The tools pl.wp uses is [[pl:MediaWiki:Gadget-sk.js]], but be aware that it also includes some non-code cleanup and some pl.wp-specific rules for template replacements etc.

(In reply to comment #2)

(In reply to comment #1)

It would be very helpful if you can provide a list of any other default
whitespace rules for other wikitext elements. It is simpler to implement
this
in one shot rather than piecemeal.

Sorry, I post these when I notice Parsoid is doing things not in my way :)

Thats okay. I was not complaining, just making a request. :).

You can test existing Parsoid behavior @ http://parsoid.wmflabs.org/_html/ and report what needs fixing.

The French Wikipedia would be interested in this change as well, since they use a lot of "extra" spaces, and the headers are no exception.

Okay, I started to tackle this. The basic fix is quite simple, but it introduces a ton of noisy diffs in our parser tests and it will likely introduce a lot of noisy diffs in roundtrip testing as well. We could fix our testing infrastructure to ignore them, but a better solution is to leave existing headings untouched.

I can instead add this rule on new headings and leave old headings untouched.

But, looking at pages on enwp, I see (by clicking around on a about 10 "random" pages) that most headings don't use spaces after/before "==". I assume these extra spaces will not be an issue on enwp and doesn't violate any style guidelines there?

(In reply to comment #5)

I assume these
extra spaces will not be an issue on enwp and doesn't violate any style
guidelines there?

No, per [[MOS:HEAD]], "Spaces between the equal signs and the heading text are optional, and will not affect the way the heading is displayed". It doesn't mention anything about them being uncool, and most of the wikis I frequent use them for readability.

Change 96790 had a related patch set uploaded by Subramanya Sastry:
(Bug 51744) Add space around = chars in new headings

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

Change 96790 merged by jenkins-bot:
(Bug 51744) Add space around = chars in new headings

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

I assume this is fixed now? Thank you!

Yes. Will be deployed today. Closing this bug now.

Change 101275 had a related patch set uploaded by GWicke:
Merge "(Bug 51744) Add space around = chars in new headings"

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

Change 101318 had a related patch set uploaded by GWicke:
(Bug 51744) Add space around = chars in new headings

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

Change 101275 merged by GWicke:
Merge "(Bug 51744) Add space around = chars in new headings"

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

Change 101318 merged by GWicke:
(Bug 51744) Add space around = chars in new headings

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