Page MenuHomePhabricator

Tweak P-wrapping (tokenhandler pass OR DOM pass) to avoid swallowing trailing style tags that follow a template opening tag (and ditto for leading style tags that preced a template closing tag)
Open, MediumPublic

Description

In https://en.wikipedia.org/w/index.php?title=American_Bank_Note_Company_Printing_Plant&oldid=945672756, when I edit the "Landmark status" section, the paragraph starting with "The announcement also cited..." is incorrectly included as part of the following quote template.

Screen Shot 2020-03-15 at 10.47.17 AM.png (1×2 px, 692 KB)

Event Timeline

matmarex subscribed.

Syntax from the article for reference:

... Benika Morokuma, of the [[Municipal Art Society]] described the building in her testimony supporting the landmark designation:<ref name="mas.testimony"/>{{quote|The facade of the plant is a clear example ...}}

The {{quote}} template starts with a <templatestyles ...> tag. Because there is no newline before {{quote|... in the article, the tag is considered to belong to the paragraph preceding the quote. As a result, the entire paragraph is considered to be "template-affected", and not visually editable.

In this case VisualEditor only does what Parsoid tells us. Maybe Parsoid could be smarter about this situation, but I'm not sure if that is possible. (I feel like I saw previous reports of similar problems, but I can't find any duplicate tasks right now.)

Meanwhile, you can avoid the problem in the article by putting the {{quote|...}} template on a separate line.

ssastry triaged this task as Medium priority.Mar 16 2020, 9:30 PM
ssastry subscribed.

We could possibly tweak the paragraph wrapping algorithm to be smarter about style tags that trail the paragraph and push it out of the paragraph. We had to add this logic for meta tags in the first place so, we may just have to treat templatestyle style tags similarly.

ssastry renamed this task from VE incorrectly parses quote template to Tweak P-wrapping (tokenhandler pass OR DOM pass) to avoid swallowing trailing style tags that follow a template opening tag (and ditto for leading style tags that preced a template closing tag).Mar 17 2020, 5:36 PM
ssastry moved this task from Needs Triage to Feature requests on the Parsoid board.