You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often find myself wanting to include a string with some formatting into a translated sentence. E.G "The user Sigmund performed this commit"
Looking at the source code it seems formatMessage allways performs html-escape (unless you hit the precompiled format optimization which doesn't and is probably a security issue...)
Recent versions of dustjs-linkedin allows you to return data from a helper and utilize the dustjs filters to do escaping. With this approach the following diff:
I'm facing the same issue. Our intl team is now loving working with react-intl and how we can easily let them tweak the messages, but we still need to split strings if they contain markup when using dust-intl.
Any chance that something like this suggestion could be accepted? Thanks!
I often find myself wanting to include a string with some formatting into a translated sentence. E.G "The user Sigmund performed this commit"
Looking at the source code it seems formatMessage allways performs html-escape (unless you hit the precompiled format optimization which doesn't and is probably a security issue...)
Recent versions of dustjs-linkedin allows you to return data from a helper and utilize the dustjs filters to do escaping. With this approach the following diff:
will allow formatMessage to be used like this:
If filters are not set the default is still to html-escape, so it should be backwards compatible with existing templates.
The text was updated successfully, but these errors were encountered: