Allow a set of whitelisted HTML tags inside of i18n.defaultMessage
.
#24090
Labels
enhancement
New value added to drive a business result
Project:i18n
stale
Used to mark issues that were closed for being stale
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
As it turned out Kibana has many places where we may want to use HTML tags/elements inside of
defaultMessage
, e.g. long texts that include<p>
,<ul>
or<strong>
. For example, for the long text that needs<p>
we should write something like this:but ideally we'd rather have something like this:
Currently it's not supported by the
FormattedMessage
we use for React translations (formatjs/formatjs#513), only byFormattedHTMLMessage
usage of which is discouraged and that doesn't work well withtextElement=React.Fragment
we use to avoid additional spans.We should define a set of text-level HTML tags (+
<a>
and<img>
) that we'll allow within localizable text. I like the idea that DOM Overlays rely on, maybe we can implement something similar. The solution we'll find should work for both React and Angular in a similar fashion, and, it seems, will require quite a bit of work on our end./cc @timroes @pavel06081991 @elastic/kibana-platform
The text was updated successfully, but these errors were encountered: