Valid YAML document (with escaped solidus) is not accepted by the parser
graywolf-at-work opened this issue · comments
graywolf-at-work commented
Hello,
today I hit a bug when trying to parse a YAML document using this library.
Reproduction can be simplified to this document:
"f\/oo"
That is valid document[0], and for example ruby parses it just fine:
$ ruby -ryaml -e 'puts YAML.load %q{"f\\/oo"}'
f/oo
However this library does not accept it:
package main
import (
"gopkg.in/yaml.v3"
)
func main() {
t := ""
if err := yaml.Unmarshal([]byte(`"f\/oo"`), &t); err != nil {
panic(err)
}
}
Error:
panic: yaml: found unknown escape character
0: https://yaml.org/spec/1.2.2/#57-escaped-characters , [53]
Tina Müller (tinita) commented
Search for "slash" in the issues. There are already open issues about this.