Merge pull request #6 from Seedmanc/main

Avoid duplicating backslashes for already escaped brackets.
pull/7/head
animo 2022-11-25 15:27:04 +09:00 committed by GitHub
commit 8c1a7a4e17
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 = [];