Page MenuHomePhabricator

Visual editor inserts extraneous blank lines (due to <nowiki/> pulled out of paragraph and then disappearing)
Closed, ResolvedPublic

Event Timeline

RoySmith created this task.Jun 23 2018, 1:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 23 2018, 1:56 AM

Any change to the first paragraph of the page seems to cause this.

There is a <nowiki/> tag in it, which becomes an alienMeta in our model and is pulled out of the paragraph (after it). But when we serialize to HTML, it seems that it is not put back in the expected place, resulting in HTML like this that we send to Parsoid:

<p id="mwAg">On June 12, 2018, …</p><span typeof="mw:Nowiki" id="mwBQ"></span><p id="mwCQ">Describing the image…</p>

The Parsoid presumably wraps the <span> in a paragraph, then removes the now-useless empty <nowiki/>, and that leaves it with an empty paragraph, which becomes two newlines in wikitext?

The Parsoid presumably wraps the <span> in a paragraph, then removes the now-useless empty <nowiki/>, and that leaves it with an empty paragraph, which becomes two newlines in wikitext?

More or less. It serializes as,

On June 12, 2018, …

<nowiki/>

Describing the image …

and then nowiki stripped in https://github.com/wikimedia/parsoid/blob/master/lib/html2wt/WikitextSerializer.js#L1457 leaving the three blank lines.

VE should be dropping nowikis in edited context and letting Parsoid reconstitute them where necessary.

ssastry moved this task from Backlog to Non-Parsoid Tasks on the Parsoid board.Jun 26 2018, 3:08 PM

From VE's perspective, this is basically the same issue as T96528: Empty annotations cannot be deleted. <nowiki/> (or <span typeof="mw:Nowiki"></span>) is treated the same as e.g. <small></small> by us, they only differ in Parsoid's handling.

matmarex renamed this task from Visual editor inserts extraneous blank lines. to Visual editor inserts extraneous blank lines (due to <nowiki/> pulled out of paragraph and then disappearing).Jun 27 2018, 3:30 PM
Restricted Application added a subscriber: jeblad. · View Herald TranscriptJun 27 2018, 3:30 PM
Vvjjkkii renamed this task from Visual editor inserts extraneous blank lines (due to <nowiki/> pulled out of paragraph and then disappearing) to lfaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from lfaaaaaaaa to Visual editor inserts extraneous blank lines (due to <nowiki/> pulled out of paragraph and then disappearing).Jul 2 2018, 10:36 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
Deskana triaged this task as Low priority.Jul 3 2018, 6:47 PM
Deskana moved this task from To Triage to Freezer on the VisualEditor board.

The examples on this task so far have been mostly mistakes in syntax already present on the page, but per T212812, syntax like [[1823]]<nowiki/>an is not a mistake and quite common on Basque Wikipedia (https://eu.wikipedia.org/), so this issue appears more often there.

@matmarex I guess you are dealing with the matter. I bring the comment over from the other thread opened for the issues found in the Basque wikipedia.

For another clue, regardless of nowiki codes, I opened now the article Foruen amaiera Hego Euskal Herrian by clicking on "aldatu" (Visual Editor), and after loading it adds a parasitic blank line below the first paragraph in the article. Thanks

For another clue, regardless of nowiki codes, I opened now the article Foruen amaiera Hego Euskal Herrian by clicking on "aldatu" (Visual Editor), and after loading it adds a parasitic blank line below the first paragraph in the article. Thanks

I think this is a different problem (and arguably not a bug). The blank line here is a "slug", and it exists to allow inserting text between the image and the navigation box on the right.

In this case it's a little useless, since because the image and the box are floating on the right, there is no visual difference between inserting text before, between or after them. But if they were shown without floating (e.g. on a narrow screen of a mobile phone), it would matter.

Regardless, this "slug" does not result in additional paragraphs being added to the wikitext of the page (unless you click it to add a paragraph).

matmarex moved this task from Inbox to Low Priority on the Editing QA board.Jun 12 2019, 4:13 PM
marcella edited projects, added Skipped QA; removed Editing QA.Jul 24 2019, 5:20 PM
marcella moved this task from QA to Product owner review on the VisualEditor (Current work) board.
ppelberg closed this task as Resolved.Sep 2 2019, 11:57 PM
ppelberg claimed this task.