Skip to content

Commit 9b5e44e

Browse files
committed
anrfc-lister: refactor to make adding a new section easier, part 2
1 parent a2f0328 commit 9b5e44e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

anrfc-lister.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,10 @@ class ANRFC {
383383
}
384384

385385
makeWikitext( wikitext, wikitextToWrite, initiatedDate, targetSection ) {
386-
const discussions = [
387-
'== Administrative discussions ==',
388-
'== Requests for comment ==',
389-
'== Deletion discussions ==',
390-
'== Other types of closing requests =='
391-
];
386+
const discussions = [];
387+
for ( const section of this.sections ) {
388+
discussions.push( '== ' + section + ' ==' );
389+
}
392390

393391
const firstPart = wikitext.slice( 0, wikitext.indexOf( discussions[ targetSection ] ) );
394392
wikitext = wikitext.slice( wikitext.indexOf( discussions[ targetSection ] ) );

0 commit comments

Comments
 (0)