Fix quoting of replacement text, avoiding "unmatched ]"

This commit is contained in:
df 2021-02-21 12:33:55 +00:00 committed by HummyPkg
parent f5180dc144
commit 32ac3c8421

View File

@ -103,13 +103,13 @@ proc ::js::_unescape {str} {
proc ::js::escape {str} { proc ::js::escape {str} {
return [subst -nobackslashes -novariables \ return [subst -nobackslashes -novariables \
[regsub -all -- {[^A-Za-z0-9@*_+-./]+} $str \ [regsub -all -- {[^A-Za-z0-9@*_+-./]+} $str \
{[::js::_escape "&"]}]] {[::js::_escape {&}]}]]
} }
proc ::js::unescape {str} { proc ::js::unescape {str} {
return [subst -nobackslashes -novariables \ return [subst -nobackslashes -novariables \
[regsub -all -- {%(u[[:xdigit:]]{2})?[[:xdigit:]]{2}} $str \ [regsub -all -- {%(u[[:xdigit:]]{2})?[[:xdigit:]]{2}} $str \
{[::js::_unescape "&"]}]] {[::js::_unescape {&}]}]]
} }
alias jsescape ::js::escape alias jsescape ::js::escape