Guidance on how to use HTML within localization strings in Tecton.
At the moment, intl-messageformat somewhat supports parsing HTML, but it's limited in its functionality and ease of use. We are discussing internally how we can best support it in the future.
In the meantime, what you can do is use the ignoreTag option, which will parse the HTML tags as part of the string. From there, you can dangerously set the innerHTML, in the element you need it applied to.
// Given the following string
// {
// myString: "<li>My string</li>";
// }
const myStringResult = tecton.sources.loc(
"myString",
undefined,
{ ignoreTag: true }
);
// Returns "<li>My string</li>".
document.querySelector(".my-element").innerHTML = myStringResult;