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
This is not really needed in a React / JavaScript context as all the strings would be escaped anyway (unless you use something dangerouslySetInnerHTML)
What does it mean "unless you use something dangerouslySetInnerHTML"?
Does it mean that in JavaScript context writing __('Some string with <a href="https://example.com/">a link</a> in it,', 'text-domain'); would not create a link? Ok, that makes sense. Perhaps wp.i18n.sprintf should be used to create text with links then (I didn't try this yet).
Does it mean that in JavaScript context writing __('Some string with <a href="https://example.com/">a link</a> in it', 'text-domain'); would not create a link?
Correct. sprintf won't help you there. You'd need to use dangerouslySetInnerHTML to directly write HTML. Otherwise < and > get escaped.
Is
wp.i18n.esc_html__()
version planned?How to achieve this?
Is this necessary or some escaping is already happening?
The text was updated successfully, but these errors were encountered: