Merlijn van Deen has uploaded a new change for review.
Change subject: Allow <section> to be transclusion & {{#tag}}-ed
......................................................................
Allow <section> to be transclusion & {{#tag}}-ed
This commit implements functionality to retrieve the expanded DOM for a given
page, which allows <section> tags to be included and to be created using the
{{#tag}} parser function. This also allows <section> tags to be created
dynamically in templates.
The commit implements a new static function
LabeledSectionTransclusion::getWikiPageDom which is a drop-in replacement for
$parser->getTemplateDom which was used before. However, because the fully
extended WikiPage DOM can cause transclusion loops, the calling function
must take care to prevent this.
The transclusion loop protection in $frame did not cover this, so a local
protection mechanism was implemented.
Two parser tests are added in lstParserTests:
1) testing the transclusion of a template with a fixed <section> tag
2) testing the transclusion of a template which dynamically creates
a section tag using {{#tag}}
The functionality REQUIRES MediaWiki 1.18+
Class 'WikiPage' is unavailable in 1.17.
The functionality was tested with the following branches:
REL1_18
REL1_20
wmf/1.21wmf2
Change-Id: Id15a4f4c07f7fa1837b57f649414a9cbea2787e5
---
M lst.php
M lstParserTests.txt
2 files changed, 125 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion
refs/changes/30/31330/1
--
To view, visit https://gerrit.wikimedia.org/r/31330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id15a4f4c07f7fa1837b57f649414a9cbea2787e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LabeledSectionTransclusion
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits