mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-12-18 02:40:38 +00:00
Avoid adding an extra blank line before <noinclude>
Bug: T86917 Change-Id: I44209ca4549f6eb40f5ba5d94d81b59f8a75fa79
This commit is contained in:
parent
59746bbff5
commit
334b9661b0
|
@ -158,16 +158,19 @@
|
|||
'<templatedata>\n' + newTemplateData + '\n</templatedata>'
|
||||
);
|
||||
} else {
|
||||
if ( isPageSubLevel ) {
|
||||
// Add the <templatedata>
|
||||
finalOutput = fullWikitext + '\n<templatedata>\n' +
|
||||
finalOutput = fullWikitext;
|
||||
if ( fullWikitext.substr( -1 ) !== '\n' ) {
|
||||
finalOutput += '\n';
|
||||
}
|
||||
|
||||
if ( !isPageSubLevel ) {
|
||||
finalOutput += '<noinclude>\n';
|
||||
}
|
||||
finalOutput += '<templatedata>\n' +
|
||||
newTemplateData +
|
||||
'\n</templatedata>\n';
|
||||
} else {
|
||||
// If we are not in a subpage, add <noinclude> tags
|
||||
finalOutput = fullWikitext + '\n<noinclude>\n<templatedata>\n' +
|
||||
newTemplateData +
|
||||
'\n</templatedata>\n</noinclude>\n';
|
||||
if ( !isPageSubLevel ) {
|
||||
finalOutput += '</noinclude>\n';
|
||||
}
|
||||
}
|
||||
return finalOutput;
|
||||
|
|
Loading…
Reference in a new issue