Skip to content

Commit 88738df

Browse files
committed
UnblockReview: properly split <nowiki> tags
so that the page doesn't eat them
1 parent 6479a2b commit 88738df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

UnblockReview/modules/UnblockReview.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,16 @@ export class UnblockReview {
161161

162162
// if there's a literal signature and no nowiki elements,
163163
// there must be a real signature
164-
if ( !text.includes( '<nowiki>' ) ) {
164+
// eslint-disable-next-line no-useless-concat
165+
if ( !text.includes( '<no' + 'wiki>' ) ) {
165166
return true;
166167
}
167168

168169
// Save all nowiki spans
169170
const nowikiSpanStarts = []; // list of ignored span beginnings
170171
const nowikiSpanLengths = []; // list of ignored span lengths
171-
const NOWIKI_RE = /<nowiki>.*?<\/nowiki>/g;
172+
// eslint-disable-next-line no-useless-concat
173+
const NOWIKI_RE = new RegExp( '<no' + 'wiki>.*?</no' + 'wiki>', 'g' );
172174
let spanMatch;
173175
do {
174176
spanMatch = NOWIKI_RE.exec( text );

0 commit comments

Comments
 (0)