mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-10 00:05:38 +00:00
Add double backslash as a literal escape for a single backslash
Fixes #1692
This commit is contained in:
parent
d113344abf
commit
297c230353
@ -369,8 +369,8 @@ func stringValue() yqAction {
|
||||
log.Debug("rawTokenvalue: %v", rawToken.Value)
|
||||
value := unwrap(rawToken.Value)
|
||||
log.Debug("unwrapped: %v", value)
|
||||
value = strings.ReplaceAll(value, "\\\"", "\"")
|
||||
value = strings.ReplaceAll(value, "\\n", "\n")
|
||||
replacer := strings.NewReplacer("\\\\", "\\", "\\\"", "\"", "\\n", "\n")
|
||||
value = replacer.Replace(value)
|
||||
log.Debug("replaced: %v", value)
|
||||
return &token{TokenType: operationToken, Operation: createValueOperation(value, value)}, nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user