Hard tabs fail to parse
Closed this issue · 5 comments
kevinsawicki commented
The following content does not parse if using \t
:
'a':
'b':
'c': """
d
e
"""
But switching from \t
to a two space indent works fine.
johan commented
Interesting. Works without the e:
node -e 'console.log(require("cson-safe").parse("a:\n\tb:\n\t\tc: \"\"\"\nd\n\t\"\"\""));'
node -e 'console.log(require("cson-safe").parse("c: \"\"\"\nd\n\t\"\"\""));'
Doesn't work with it:
node -e 'console.log(require("cson-safe").parse("a:\n\tb:\n\t\tc: \"\"\"\nd\n\te\"\"\""));'
node -e 'console.log(require("cson-safe").parse("c: \"\"\"\nd\n\te\"\"\""));'
kevinsawicki commented
Yeah, looks like the hard tab in the string is what does it.
kevinsawicki commented
Hmm, I guess this is what JSON.parse
is "supposed" to do, https://code.google.com/p/chromium/issues/detail?id=52560
Still seems odd though since the \n
was unescaped and still parsed just fine.
kevinsawicki commented
Changing https://github.com/groupon/cson-safe/blob/950ef169214ef7698e335ae957022dcd6d706655/src/parse.coffee#L80 to handle strings with either quote type does fix it.
jkrems commented
v1.0.5