Skip to content

Commit

Permalink
add space before pipe in template wikicode
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Aug 26, 2024
1 parent 52cbe4f commit 680be46
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
10 changes: 5 additions & 5 deletions src/modules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@
// Put at top for historical reasons. People are used to it being there.
banners.unshift(
'{{subst:WPAFC/article' +
( revId ? '|oldid=' + revId : '' ) +
( revId ? ' |oldid=' + revId : '' ) +
'}}'
);

Expand All @@ -1679,9 +1679,9 @@
// add biography banner to array
if ( isBiography ) {
banners.push(
'{{WikiProject Biography|living=' +
'{{WikiProject Biography |living=' +
( lifeStatus !== 'unknown' ? ( lifeStatus === 'living' ? 'yes' : 'no' ) : '' ) +
'|listas=' + subjectName +
' |listas=' + subjectName +
'}}'
);
}
Expand All @@ -1707,8 +1707,8 @@
// Add |class= to shell.
// Add |1=. Improves readability when lots of other parameters present.
wikicode = '{{WikiProject banner shell' +
( newAssessment ? '|class=' + newAssessment : '' ) +
'|1=\n' +
( newAssessment ? ' |class=' + newAssessment : '' ) +
' |1=\n' +
banners.join( '\n' ) +
'\n}}\n' +
wikicode;
Expand Down
62 changes: 31 additions & 31 deletions tests/test-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ describe( 'AFCH.addTalkPageBanners', () => {
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592485}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592485}}
}}`
);
} );
Expand All @@ -150,8 +150,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592485}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592485}}
}}
== Hello ==
Expand All @@ -172,8 +172,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592485}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592485}}
{{WikiProject Women}}
}}
{{translated page|ar|بحيرة كناو|version=|small=no|insertversion=|section=}}`
Expand All @@ -193,8 +193,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592485}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592485}}
{{WikiProject Women}}
}}
{{translated page|ar|بحيرة كناو|version=|small=no|insertversion=|section=}}`
Expand All @@ -212,8 +212,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592485}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592485}}
{{WikiProject Women}}
}}`
);
Expand All @@ -232,8 +232,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592507}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592507}}
{{WikiProject Women}}
{{WikiProject Women's sport}}
{{WikiProject Somalia}}
Expand All @@ -256,8 +256,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592507}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592507}}
{{WikiProject Women}}
{{WikiProject Women's sport}}
{{WikiProject Somalia}}
Expand All @@ -281,12 +281,12 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = 'Lazarut, Raluca';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592507}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592507}}
{{WikiProject Film}}
{{WikiProject Women}}
{{WikiProject Television}}
{{WikiProject Biography|living=yes|listas=Lazarut, Raluca}}
{{WikiProject Biography |living=yes |listas=Lazarut, Raluca}}
{{WikiProject Romania}}
}}`
);
Expand All @@ -307,8 +307,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592507}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592507}}
{{WikiProject Women}}
{{WikiProject Women's sport}}
{{WikiProject Somalia}}
Expand All @@ -326,9 +326,9 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = 'Jones, Bob';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|class=B|1=
{{subst:WPAFC/article|oldid=592496}}
{{WikiProject Biography|living=yes|listas=Jones, Bob}}
`{{WikiProject banner shell |class=B |1=
{{subst:WPAFC/article |oldid=592496}}
{{WikiProject Biography |living=yes |listas=Jones, Bob}}
{{WikiProject Africa}}
{{WikiProject Alabama}}
}}`
Expand All @@ -345,9 +345,9 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592496}}
{{WikiProject Biography|living=no|listas=}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592496}}
{{WikiProject Biography |living=no |listas=}}
}}`
);
} );
Expand All @@ -365,8 +365,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592496}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592496}}
{{WikiProject Somalia}}
}}`
);
Expand All @@ -382,8 +382,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|class=Disambig|1=
{{subst:WPAFC/article|oldid=592681}}
`{{WikiProject banner shell |class=Disambig |1=
{{subst:WPAFC/article |oldid=592681}}
{{WikiProject Disambiguation}}
}}`
);
Expand All @@ -400,8 +400,8 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell|1=
{{subst:WPAFC/article|oldid=592681}}
`{{WikiProject banner shell |1=
{{subst:WPAFC/article |oldid=592681}}
{{OKA}}
}}
{{translated page|pl|Katowice Załęże|version=|small=no|insertversion=|section=}}`
Expand Down

0 comments on commit 680be46

Please sign in to comment.