Skip to content

Commit cd869bb

Browse files
authored
fix prompt-bracket-checker miscounting of literal tokens (#16669)
1 parent 957888a commit cd869bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
function checkBrackets(textArea, counterElt) {
77
var counts = {};
8-
(textArea.value.match(/[(){}[\]]/g) || []).forEach(bracket => {
8+
(textArea.value.match(/(?<!\\)[(){}[\]]/g) || []).forEach(bracket => {
99
counts[bracket] = (counts[bracket] || 0) + 1;
1010
});
1111
var errors = [];

0 commit comments

Comments
 (0)