fixed backslashes not being stripped for special characters in double quotes

This commit is contained in:
2026-02-19 00:33:02 -05:00
parent c112e4f6ee
commit 0d200ba089
2 changed files with 84 additions and 3 deletions

View File

@@ -909,9 +909,16 @@ pub fn unescape_str(raw: &str) -> String {
while let Some(q_ch) = chars.next() {
match q_ch {
'\\' => {
result.push(q_ch);
if let Some(next_ch) = chars.next() {
result.push(next_ch)
match next_ch {
'"' | '\\' | '`' | '$' => {
// discard the backslash
}
_ => {
result.push(q_ch);
}
}
result.push(next_ch);
}
}
'$' => {