Avoid adding an extra blank line before <noinclude>

Bug: T86917
Change-Id: I44209ca4549f6eb40f5ba5d94d81b59f8a75fa79
This commit is contained in:
Alex Monk 2016-01-12 18:21:46 +00:00
parent 59746bbff5
commit 334b9661b0

View file

@ -158,16 +158,19 @@
'<templatedata>\n' + newTemplateData + '\n</templatedata>' '<templatedata>\n' + newTemplateData + '\n</templatedata>'
); );
} else { } else {
if ( isPageSubLevel ) { finalOutput = fullWikitext;
// Add the <templatedata> if ( fullWikitext.substr( -1 ) !== '\n' ) {
finalOutput = fullWikitext + '\n<templatedata>\n' + finalOutput += '\n';
}
if ( !isPageSubLevel ) {
finalOutput += '<noinclude>\n';
}
finalOutput += '<templatedata>\n' +
newTemplateData + newTemplateData +
'\n</templatedata>\n'; '\n</templatedata>\n';
} else { if ( !isPageSubLevel ) {
// If we are not in a subpage, add <noinclude> tags finalOutput += '</noinclude>\n';
finalOutput = fullWikitext + '\n<noinclude>\n<templatedata>\n' +
newTemplateData +
'\n</templatedata>\n</noinclude>\n';
} }
} }
return finalOutput; return finalOutput;