Is there a way to encode HTML on text parameters?

When using a text element provided by a parameter on an exported component, it seems like quotes aren’t getting encoded, and are breaking the component. For example, here’s a component with a hand-encoded title (entered as we&apos[semicolon]re):

And here’s the same component with a simple apostrophe:

Of course, HTML elements should be encoded properly, but this is pretty hard to train end users on. Is there a way to automatically encode these, or to handle these characters more gracefully?

Hello Andy,

Thank you for the inquiry.

You can use Twig’s “raw” filter.

Example::

{{ "we're):" | raw }}

Make sure that Twig is enabled in the Cornerstone > Theme Options panel. For more info about how Twig template work in the theme, please check this documentation: https://theme.co/docs/twig

Best regards,
Ismael