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:
Moriel Schottlender 2014-11-25 00:31:24 -05:00 committed by Jforrester
parent 3137eb1fd0
commit 4c236dc961

View file

@ -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';
}
}