{% set base_class = c.css_class or '' %} {% set tag_map = { 'h1': 'fcu-text--h1', 'h2': 'fcu-text--h2', 'h3': 'fcu-text--h3', 'h4': 'fcu-text--h4', 'p': 'fcu-text--p', 'label': 'fcu-text--label', 'span': 'fcu-text--span' } %} {% if not ('fcu-text--' in base_class) %} {% set base_class = tag_map.get(c.tag, 'fcu-text--p') + ' ' + base_class %} {% endif %} {% if 'text-muted' in base_class %}{% set base_class = base_class.replace('text-muted', 'fcu-text--muted') %}{% endif %} {% if 'text-primary' in base_class %}{% set base_class = base_class.replace('text-primary', 'fcu-text--primary') %}{% endif %} {% if 'text-success' in base_class %}{% set base_class = base_class.replace('text-success', 'fcu-text--success') %}{% endif %} {% if 'text-danger' in base_class %}{% set base_class = base_class.replace('text-danger', 'fcu-text--danger') %}{% endif %} {# nosemgrep: no-interpolation-in-tag — c.tag is a Python-controlled component attribute (TextComponent.tag, defaults to "p"), never user input. #} <{{ c.tag }} {% if c.id %}id="{{ c.id }}"{% endif %} class="fcu-text {{ base_class.strip() }}"> {{ c.content }}