mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-23 23:43:54 +00:00
Correct placement of <noinclude> tags
The noinclude tags should appear only if the page is not a subpage and only around the <templatedata> tags. Change-Id: I492bb35c8f2c70235f3ceefdddcc4df6548d7469
This commit is contained in:
parent
3137eb1fd0
commit
4c236dc961
|
@ -873,14 +873,16 @@
|
|||
'<templatedata>\n' + tdOutput + '\n</templatedata>'
|
||||
);
|
||||
} else {
|
||||
// Add the <templatedata>
|
||||
finalOutput = originalTemplateDataWikitext + '\n<templatedata>\n' +
|
||||
tdOutput +
|
||||
'\n</templatedata>\n';
|
||||
|
||||
// If we are not in a subpage, add <noinclude> tags
|
||||
if ( !isPageSubLevel ) {
|
||||
finalOutput = '\n<noinclude>' + finalOutput + '</noinclude>\n';
|
||||
if ( isPageSubLevel ) {
|
||||
// Add the <templatedata>
|
||||
finalOutput = originalTemplateDataWikitext + '\n<templatedata>\n' +
|
||||
tdOutput +
|
||||
'\n</templatedata>\n';
|
||||
} else {
|
||||
// If we are not in a subpage, add <noinclude> tags
|
||||
finalOutput = originalTemplateDataWikitext + '\n<noinclude>\n<templatedata>\n' +
|
||||
tdOutput +
|
||||
'\n</templatedata>\n</noinclude>\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue