Closed eemeli closed 6 years ago
@SlexAxton I just released messageformat-parser 3.0.0-beta.1 to npm, under the next
tag. It drops the \
escapes and includes the codemod.
Sad that that’s the standard, but obviously the right choice. On Sat, Mar 17, 2018 at 7:47 AM Eemeli Aro notifications@github.com wrote:
@SlexAxton https://github.com/slexaxton I just released messageformat-parser 3.0.0-beta.1 to npm, under the next tag. It drops the \ escapes and includes the codemod.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/messageformat/parser/issues/7#issuecomment-373917589, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF5KpSj1bKK3Fo_jMo1Q4iWB5Hu0WYfks5tfQXugaJpZM4SuuZN .
Following on from messageformat/messageformat.js#171:
We should make
\
a non-special character, and just support'{}#'
escaping. This also means dropping support for\u0123
Unicode escapes. It should not be the responsibility of the MessageFormat parser to handle those, as it's done byJSON.parse
or whichever other tool is turning bytes into a JavaScript string.Specific use case that should be made easier by this change: atm in order to get the literal string
\u0123
from a.json
file to the output of the parser requires quadruple-escaping the\
, so the file on disc includes something like"\\\\u0123"
, which is just silly.As this would be a breaking change, we'd need to increment the parser major version (already released a 2.0 of it earlier...), and I'm working on a codemod for this.