Closed ceremcem closed 7 years ago
I'm also no expert in this area, since I generally avoid invalid characters on my keys or can never have them at all and never had to escape keys. You might want to check the unit tests tho, it might give hints.
@ceremcem is right here. You need two backslashes because one's eaten by JS.
one's eaten by JS
👻
Ractive uses a single backslash (
\
) as the escape character in the strings but if we want to include a single backslash in the string, we should use double backslash (\\
).Why does documentation contain single backslash strings in the examples?
For example, in Ractive.splitKeyPath() section, we have the following example:
But this does not produce
['foo', 'bar.baz']
: playgroundCorrect form should be
Ractive.splitKeypath( 'foo.bar\\.baz' )
, or am I missing something?