Page MenuHomePhabricator

Default whitespace for lists (*, #, ; :) should include a space after the list token
Closed, ResolvedPublic

Description

Default whitespace for lists (*, #, ; :) should include a space after the list token. Or in other words: for newly inserted list items, prefer "* text" to "*text". It's prettier :)

(Is this a Parsoid issue?)


Version: unspecified
Severity: enhancement

Details

Reference
bz50771

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:45 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz50771.
matmarex created this task.Jul 4 2013, 8:34 PM

(In reply to comment #0)

(Is this a Parsoid issue?)

Yes.

(Also, I think I agree with this change.)

I have a fix for this, but it just makes a lot of our existing html2wt and html2html tests fail because of the extra leading space. I'll have to fix our test result normalization code to get smarter before I submit this for review.

I'm assuming this is not not high priority.

Change 72112 had a related patch set uploaded by Subramanya Sastry:
WIP: (Bug 50771) Add space after bullets for new lists

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

See also for whitespace handling in the DOM: bug 51004

Change 72112 merged by jenkins-bot:
(Bug 50771) Add space after bullets for new lists

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

So is this fixed now?

Yes. Ideally we should probably try to match the styling of other list items when a new item is added, but that can be done later and in another bug.

See bug 51654 for white-space matching.

I don't think the resolution of this bug was correct.

The PHP parser generates:
<li> x
for * x

and

<li>x
for *x

I think Parsoid should be matching this behavior. If VE wants spaces before list items in wikitext by default, it should be inserting a space as the first character inside the <li>.

(In reply to C. Scott Ananian from comment #9)

I don't think the resolution of this bug was correct.
The PHP parser generates:
<li> x
for * x
and
<li>x
for *x
I think Parsoid should be matching this behavior.

If VE wants spaces before list items in wikitext by default, it should be
inserting a space as the first character inside the <li>.

No. Firstly, this isn't a VE-requested change, it's a community requested change for Parsoid to output wikitext following the behaviour expected of wikitext users, explicitly favouring "* Foo" over "*Foo". Secondly, VE doesn't care how the platform on which it is running stores the data as long as it comes back consistently in HTML.