Hello,
I implemented custom localization strings following Localization – Snipcart Documentation
Code
Snipcart.api.session.setLanguage('en', {
mcm: {
tos_consent: MCM.translations.tos_consent.en,
}
});
MCM.translations.tos_consent.en logs in the console to: <strong>text</strong>
Now I am using the custom string inside a template following this example: Order custom fields – Snipcart Documentation
Code
<payment section="top">
<div>
<p>
<snipcart-checkbox name="agb" required></snipcart-checkbox>
<snipcart-label for="agb">{{ $localize('mcm.tos_consent') }}</snipcart-label>
</p>
</div>
</payment>
All is working fine with plain text. But as soon as I have HTML tags inside those translation strings, they are rendered as text like <strong>text</strong>
for the checkbox label.
The generated markup
<p><input type="checkbox" name="agb" id="agb_d1e81593-20af-4841-bc90-b9fdb4c1963d" class="snipcart-checkbox" required="required"> <label for="agb_d1e81593-20af-4841-bc90-b9fdb4c1963d" class="snipcart-form__label"><strong>text</strong></label></p>
How can I render HTML in this situation?
I already tried manually escaping all HTML chars when building the strings but it didn’t help.