Page MenuHomePhabricator

VisualEditor: HTML content model constraints are sometimes violated
Closed, ResolvedPublic

Description

See
https://it.wikipedia.org/w/index.php?title=Utente%3AElitre_%28WMF%29%2FSandbox_VE3&diff=63988076&oldid=63988055 ,
or https://it.wikipedia.org/w/index.php?title=Oreste_Tommasini&diff=63836558&oldid=61161898, or https://it.wikipedia.org/w/index.php?title=Frederic_William_Maitland&diff=63692381&oldid=59785358 .

Reproduced with Chrome, FF, Opera (unlogged), tested with both skins.

You only need to add the Template:Interprogetto to an existing page or a new one.
Useless code like <span data-ve-ignore="true" about="g0.8632714317645878"></span> is added.
James, bug 59653, IMHO, had a similar problem.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=60375

Details

Reference
bz60897

Event Timeline

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

There was a related issue beforehand – but this isn't getting copied, so I can't work out out data-ve-ignore is getting added to the HTML?

This extra HTML is correctly added here for the sake of putting something meaningful into the external clipboard. data-ve-ignore tells the converter to ignore it if it's pasted into another VE instances, and about="g[random]" tells Parsoid to ignore it. However the about grouping appears not to be working at Parsoids end:

HTML:
<p><span about="g1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;href&quot;:&quot;Template:Interprogetto&quot;,&quot;wt&quot;:&quot;Interprogetto&quot;},&quot;params&quot;:{&quot;commons&quot;:{&quot;wt&quot;:&quot;cats&quot;}}}}]}" data-ve-no-generated-contents="true"></span><span data-ve-ignore="true" about="g1"></span><ul data-ve-ignore="true" about="g1">
<li>Foo</li>
</ul>
<span data-ve-ignore="true" about="g1">

</span></p>

Wikitext:
{{Interprogetto|commons = cats}}

  • Foo

<span data-ve-ignore="true" about="g1"></span>

The first about-grouped sibling is discarded, but the subsequent ul and span are not.

So this is caused by new templates always being inline templates, as we don't know if they are block templates until they render. As a result the above HTML is invalid (<ul> inside a <p>) which after Parsoid fixes, means the about-grouped items are no longer siblings.

(In reply to comment #5)

Is Bug 60375 related?

Looks like it.

Change 111518 had a related patch set uploaded by Esanders:
Only generate transclusion contents for clipboard

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

Change 111518 merged by jenkins-bot:
Only generate transclusion contents for clipboard

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