emoji_support contains bad content where there is a literal string
longkai opened this issue Β· comments
So when you set emoji_support
to true, adding a test case to the unicode_test.go
:
{
name: "literal string",
yamlStr: `a: |
hello π\n`,
expectedStr: `a: |
hello π\n`,
},
Which results:
parsed string does not match:
expected: a: |
hello π\n
got: a: "hello πn"
I suppose the literal string turns one line due to the go-yaml
library. However, the tail n
is unacceptable.
Sorry, I should not use \n
in literal string qaq
I notice you've closed it now, but here's what I've got about the issues with the output just to keep track.
Of the 3 issues with the output:
- Double quotes around the result
- This is from the yaml library. I haven't yet thought of a context free way to get rid of these due to the way they are added into the formatted output, but I'm experimenting with solutions.
- Outputting to a single line
- This is also from the library, and this one I'm not sure why it does that. It's possible the
yaml.Node
serialization doesn't retain the|
multiline literal syntax information.
- This is also from the library, and this one I'm not sure why it does that. It's possible the
- The trailing
n
- This was a bug with
emoji_support
in 0.5.0 that I fixed in #55 and will be in version 0.6.0
- This was a bug with
Haha I also found the issue and it should advance one byte to check 'U'
.
Besides I figure it out why it always formats to a single line since it considers emoji is not printable, so the text contains special characters and always output to escaped one line instead of multi-line literal string or simple string.