-
Notifications
You must be signed in to change notification settings - Fork 23
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
(feature/advice) Parse HTML from JS strings #21
Comments
Hi, that's currently not possible out of the box, but it would certainly be possible to implement such a feature. Would you expect it to just parse every string as HTML or mark the relevant ones somehow (e.g. using tagged template literals) ? |
I think ideally every string would be parsed including quote/double quote. I'm assuming the parser fails gracefully when the content is not HTML (I think it does), and that tags such as |
It certainly would. I'm a bit concerned about the performance impact this might have in a larger project with lots of non-html strings. I think the best idea is probably to implement both options, parsing all strings or only those which are marked with a certain tag. |
That's awesome, looking forward for it :) |
In my softwares, I have template literals from which I generate HTML components. Example:
However, this "Hello" won't get extracted. So for now I do:
However, this is a bad solution as translations can now inject html & executable scripts.
Is there any other way to make those translatable string extractable?
The text was updated successfully, but these errors were encountered: