Page MenuHomePhabricator

Polish Wikipedia template {{odn}} is inserted as a block element in VE rather than inline
Closed, ResolvedPublic1 Estimated Story Points

Description

Polish Wikipedia template {{odn}} is inserted as a block element in VE rather than inline. (It generates a reference.)

Editing a random page, Insert → Template → type "odn" → type anything into the first field and a number into the second.

image.png (980×1 px, 216 KB)

It looks like a paragraph gets inserted in wikitext around it:

image.png (980×1 px, 226 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

When you ask Parsoid for a single ref it will <p> wrap it and also append a auto-generated ref list. We have code that removes the auto-generated ref list, and also unwraps documents that are a single paragraph. I suspect that they are happening in the wrong order though, so the paragraph unwrapping never happens because it thinks the document is more complex.

Hmm, ve.ce.MWTransclusionNode.static.filterRendering appears to be in the correct order. Investigating.

Looks like the problem is the newline text node between the paragraph and the autogenerated ref, so the paragraph unwrapping test fails.

Change 393059 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Fix template rendering

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

Change 393059 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Fix template rendering

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

Deskana assigned this task to Esanders.
Deskana triaged this task as Medium priority.
Deskana set the point value for this task to 1.
Deskana moved this task from To Triage to TR1: Releases on the VisualEditor board.