Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underscore extractor does not properly handle escaped characters #8

Open
amangano-edx opened this issue Feb 20, 2018 · 1 comment
Open

Comments

@amangano-edx
Copy link

The underscore template extractor does not seem to be able to properly parse strings that contain escaped characters. Such strings end up being written to the .pot file with extra escape characters.

Consider the following example:

An underscore template containing the following lines:

<%- gettext('foo\\bar') %>
<%- gettext('Bob\'s house') %>

Produces the following output in the .pot file generated by Babel:

msgid "foo\\\\bar"
msgstr ""

msgid "Bob\\'s house"
msgstr ""

This does not seem to be correct.

Please let me know if there's anything I can do to help fix this issue.

Thanks!

@amangano-edx
Copy link
Author

Would passing the strings through https://github.com/python-babel/babel/blob/master/babel/messages/jslexer.py#L87 at some point resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant