fix prompt-bracket-checker miscounting of literal tokens (#16669)

This commit is contained in:
w-e-w 2024-11-21 02:29:41 +09:00 committed by GitHub
parent 957888a100
commit cd869bb7a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@
function checkBrackets(textArea, counterElt) {
var counts = {};
(textArea.value.match(/[(){}[\]]/g) || []).forEach(bracket => {
(textArea.value.match(/(?<!\\)[(){}[\]]/g) || []).forEach(bracket => {
counts[bracket] = (counts[bracket] || 0) + 1;
});
var errors = [];