mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:45:33 +02:00
Fix string interpolation escaping (#4854)
This commit is contained in:
@ -1477,8 +1477,18 @@ pub fn parse_string_interpolation(
|
||||
end,
|
||||
};
|
||||
let str_contents = working_set.get_span_contents(span);
|
||||
|
||||
let str_contents = if double_quote {
|
||||
let (str_contents, err) = unescape_string(str_contents, span);
|
||||
error = error.or(err);
|
||||
|
||||
str_contents
|
||||
} else {
|
||||
str_contents.to_vec()
|
||||
};
|
||||
|
||||
output.push(Expression {
|
||||
expr: Expr::String(String::from_utf8_lossy(str_contents).to_string()),
|
||||
expr: Expr::String(String::from_utf8_lossy(&str_contents).to_string()),
|
||||
span,
|
||||
ty: Type::String,
|
||||
custom_completion: None,
|
||||
|
Reference in New Issue
Block a user