Skip to content

Commit 08fa6fe

Browse files
Fix harmless regex glitch
The regex included `(:? ... )` instead of `(?: ... )` when intending a non-capturing group, but this was harmless as (1) the captured group was ignored anyway and (2) the `:?` construct would helpfully match nothing. The full group would end up being something like `(:?dt|dd|/dl)` which is just slightly a superset of the intended `(?:dt|dd|/dl)` and the capture is ignored anyway, so simplify the regex.
1 parent 0320bd4 commit 08fa6fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lint.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ log('massaging HTML...');
7272
const re = new RegExp(
7373
'(<(' + tags.join('|') + ')\\b[^>]*>)' +
7474
'(.*?)' +
75-
'(?=<(:?' + tags.join('|') + '|/(' + containers.join('|') + '))\\b)',
75+
'(?=<(' + tags.join('|') + '|/(' + containers.join('|') + '))\\b)',
7676
'sg');
7777
file = file.replaceAll(
7878
re, (_, opener, tag, content) => `${opener}${content}</${tag}>`);

0 commit comments

Comments
 (0)