Page MenuHomePhabricator

Parsoid should expose content inside <includeonly> to editors instead of hiding it in the meta tag's data-parsoid attribute
Closed, ResolvedPublic

Description

See Parsoid output for includeonly blocks

[subbu@earth:~/work/wmf/parsoid] echo "foo <includeonly>''x'' [[Link]] some '''bold'''</includeonly> baz" | parse.js
...
<p data-parsoid='{"dsr":[0,65,0,0]}'>foo <meta typeof="mw:Includes/IncludeOnly" data-parsoid="{&quot;src&quot;:&quot;&lt;includeonly>''x'' [[Link]] some '''bold'''&lt;/includeonly>&quot;,&quot;dsr&quot;:[4,61,null,null]}"/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":"","dsr":[61,61,null,null]}'/> baz</p>
...

The parsed content is stuffed in data-parsoid and not exposed to clients. This should be fixed to expose the content in some way. This should be done carefully to ensure that the HTML for that hidden block doesn't interfere and change the surrounding page. So, probably the best solution is to expose this in the data-mw attribute just like for <ref> tags and other extension content.

This will fix the original bug report of visual diffs not reporting changes inside <includeonly> blocks.

Event Timeline

IKhitron created this task.Jul 10 2018, 4:29 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJul 10 2018, 4:29 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I assume that the dashes don't have anything to do with it (https://de.wikipedia.org/w/index.php?title=Intermodulation&diff=prev&oldid=179042962&diffmode=visual works as expected), but the fact that the change is inside the includeonly part.

I assume that the dashes don't have anything to do with it (https://de.wikipedia.org/w/index.php?title=Intermodulation&diff=prev&oldid=179042962&diffmode=visual works as expected), but the fact that the change is inside the includeonly part.

Possibly, but it is still a problem, because the code has transclusions.

Esanders renamed this task from Visualdiff does not recognize hyphen types to Visualdiff does not recognize content in <includeonly>.Jul 12 2018, 9:44 AM
Esanders triaged this task as Low priority.
Esanders updated the task description. (Show Details)
Esanders added a subscriber: Esanders.

From what I can see, Parsoid doesn't even expose the contents on <includeonly> tags to the editor, so we have nothing to diff. I assume it is only preserved by SelSer?

From what I can see, Parsoid doesn't even expose the contents on <includeonly> tags to the editor, so we have nothing to diff. I assume it is only preserved by SelSer?

The issue is that the template page has examples, so it is transcluded to itself, and the page looks different.

From what I can see, Parsoid doesn't even expose the contents on <includeonly> tags to the editor, so we have nothing to diff. I assume it is only preserved by SelSer?

Yes, we don't expose includeonly content right now .. but, that was probably a mistake since it is possible for editors to want to change the scope of those includeonly blocks and expose previously suppressed content on the main page.

ssastry renamed this task from Visualdiff does not recognize content in <includeonly> to Parsoid should expose content inside <includeonly> to editors instead of hiding it in the meta tag's data-parsoid attribute.Jul 20 2018, 5:36 AM
ssastry raised the priority of this task from Low to Medium.
ssastry updated the task description. (Show Details)
ssastry assigned this task to Sbailey.Jul 20 2018, 5:45 AM

Change 452837 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] Parsoid should expose content inside <includeonly> to editors

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

Change 452837 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Expose content inside <includeonly> to editors via data-mw attribute

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

Mentioned in SAL (#wikimedia-operations) [2018-08-28T18:11:35Z] <arlolra> Updated Parsoid to 61086f6 (T199246, T198221)

Arlolra closed this task as Resolved.Aug 28 2018, 6:13 PM