Avoid duplicating backslashes for the already escaped brackets.

pull/6/head
Dmitry 2022-11-22 21:02:26 +03:00 committed by GitHub
parent c07f2f708e
commit b903a69d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ function round(value) {
}
function convert(input) {
const re_attention = /\{|\[|\}|\]|[^\{\}\[\]]+/gmu;
let text = input.replaceAll("(", "\\(").replaceAll(")", "\\)");
let text = input.replaceAll("(", "\\(").replaceAll(")", "\\)").replace(/\\{2,}(\(|\))/gim,'\\$1');
let res = [];