Page MenuHomePhabricator

Content within extension tags isn't transcluded
Open, Needs TriagePublic

Description

When an extension introduces a new tag (such as <poem> or <ref>) and the content inside such tag is marked with <section> tags, then when attempting to transclude it from some other page, we get nothing. This doesn't seem to be an issue with native tags (such as <code>) so it probably has something to do with parsing order.

Demo:

This is actually a problem for an extension I'm developing that will probably be deployed on Wikiversity, so I'll try to fix it myself, but any feedback and support would be welcome.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 20 2017, 2:35 AM
Sophivorus updated the task description. (Show Details)Apr 20 2017, 2:35 AM
Sophivorus updated the task description. (Show Details)Apr 20 2017, 2:39 AM

After many hours of burning my eyes, I was able to fix this bug with MINIMAL changes. Please review and merge!

https://gerrit.wikimedia.org/r/#/c/349223/

Change 349223 abandoned by Sophivorus:
Properly transclude sections within extension tags

Reason:
Found a bug, fixing it

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

Sophivorus added a comment.EditedApr 20 2017, 5:18 PM

The first patch had a flaw, I uploaded a second one that is more robust and even easier to review.

https://gerrit.wikimedia.org/r/#/c/349256/

Change 349256 abandoned by Sophivorus:
Properly transclude sections inside extension tags

Reason:
Unfortunately this only works when <section> tags are nested one-level deep, which is good enough for most cases, but not for the case that I'm interested in. Therefore, I'm abandoning this until I can submit a patch that covers all cases.

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

Sophivorus added a comment.EditedApr 24 2017, 7:54 PM

https://gerrit.wikimedia.org/r/#/c/350013/

Now yes, I submitted a solution that passes all previous parser tests, and adds new parser tests for testing transclusion within extension tags.

Two of the new tests however are designed for testing transclusion within NESTED extension tags. Nested extension tags aren't properly handled by MediaWiki yet, so those two tests won't pass until nested extension tags are handled properly. T3310 tracks the issue, and I submitted a patch there that fixes it.

Sophivorus added a subscriber: Tpt.Apr 24 2017, 7:55 PM

Change 355772 had a related patch set uploaded (by Sophivorus; owner: Sophivorus):
[mediawiki/extensions/LabeledSectionTransclusion@master] Properly transclude sections inside extension tags

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

Change 350013 abandoned by Sophivorus:
Properly transclude sections inside extension tags

Reason:
Rebased at https://gerrit.wikimedia.org/r/#/c/355772/

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

I wasn't able to properly rebase, so I abandoned the change and recreated it at https://gerrit.wikimedia.org/r/#/c/355772/

Change 355772 abandoned by Sophivorus:
Properly transclude sections inside extension tags

Reason:
No longer needed

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