synacor / preact-i18n

Simple localization for Preact.
BSD 3-Clause "New" or "Revised" License
205 stars 18 forks source link

Sanitise fields of MarkupText #60

Open Michael-1 opened 1 year ago

Michael-1 commented 1 year ago

I am using MarkupText to be able to use translation labels with HTML markup. At the same time, I would like that the fields that are interpolated into the translation to be sanitised (e.g. <span> to be rendered as &lt;span&gt;). The background is that field contents are dynamic, and often come from user input, an API or URL parameters, so they are susceptible to cross-site scripting.