Skip to content

Commit

Permalink
fix passing of literal backslash (#16671)
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w authored Nov 21, 2024
1 parent cd869bb commit 023454b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
// If there's a mismatch, the keyword counter turns red and if you hover on it, a tooltip tells you what's wrong.

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

function checkPair(open, close, kind) {
if (counts[open] !== counts[close]) {
Expand Down

0 comments on commit 023454b

Please sign in to comment.