Page MenuHomePhabricator

VisualEditor: nowiki tags thrown right after a template
Open, MediumPublic

Description

I am filing a related common problem we meet at it.wp.

We had troubles with nowikis being thrown right after some templates when the
user did not add an extra space there, but simply edited something in that
page. See
https://it.wikipedia.org/w/index.php?title=Wikipedia&diff=61171396&oldid=61171228
.

We actually found a workaround for this:
https://it.wikipedia.org/w/index.php?title=Template:Quote&curid=224372&diff=61173726&oldid=60749506
but since this addition is apparently a nonsense, users demand that VE prevents
that behaviour instead.

They also think this is related to templates featuring some kind of table.

I did some tests as well.
I was able to reproduce an unwanted situation where the first line and the
table (which is actually a template) were mingled in a non-editable block
https://it.wikipedia.org/w/index.php?title=Utente%3AElitre_%28WMF%29%2FSandbox_VE&diff=61181542&oldid=61181524
.

But I was also able to avoid nowikis, even if the extra span tags were not
added to the template: as you can see here
https://it.wikipedia.org/w/index.php?title=Utente:Elitre_(WMF)/Sandbox_VE&diff=prev&oldid=61181473,
if the first letter of the line is actually closer to the template's final
brace (with no space between), VEditing that page will result in the text
getting automatically placed in a better position, and no nowikis in sight,
even after multiple saves of the page.

Thanks.


Version: unspecified
Severity: normal

Details

Reference
bz53548

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:03 AM
bzimport set Reference to bz53548.

Related Parsoid behavior (this is serialization of new content):

[subbu@earth lib] echo "<table><tbody><tr><td>foo</td></tr></tbody></table> a" | node parse --html2wt
{|

foo
}

<nowiki> </nowiki>a

The following is for existing content in wikitext

[subbu@earth lib] echo "{|\n|a\n|} a" | node parse --wt2wt
{|

a
} a

So, Parsoid does not split the line after the table if it is old content, but does if it is new content and can introduce a <nowiki> Since the report states that happens no matter what is edited on the page, my suspicion is that the HTML has a newline break after the <table> added by VE. Requires further investigation that I cannot do right now, but hope this is good for starters. Adding others who might have time to investigate.

Jdforrester-WMF lowered the priority of this task from High to Medium.Jan 15 2015, 12:36 AM
Jdforrester-WMF set Security to None.