fix(options): render newline in button optionlabels as <br> (Base font size "XLarge / (20 px)")

The fontsize option label "XLarge&#10;(20 px)" in config.xml survived XML
parsing as a real newline, but gT() html-escapes LF to &#10; (HTMLEscape),
so splitting the gT()'d label on "\n" was a no-op and the entity printed
literally. Split the raw label first, then gT() each part separately.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-26 20:21:33 +01:00
commit 94a203a133

View file

@ -593,7 +593,12 @@
{% if currentValue == optValue %}checked{% endif %}
class="btn-check selector_option_radio_field simple_edit_options_{{ key }}{% if attr.parent != '' %} selector_radio_childfield{% endif %}"
{% if attr.parent != '' %}data-parent="{{ attr.parent }}"{% endif %}/>
<label for="{{ key }}_{{ optValue }}" class="btn btn-outline-secondary{% if currentValue == optValue %} active{% endif %}">{{ gT(optLabels[loop.index0]|default(optValue)) }}</label>
{# row 144: a newline in an option label (&#10; in config.xml survives
XML attribute normalization) renders as a <br>. Split the RAW
label first: gT() html-escapes a newline to &#10;, which would
make the split a no-op. Each part is then gT()'d (html-escaped)
separately, so no raw HTML from translations #}
<label for="{{ key }}_{{ optValue }}" class="btn btn-outline-secondary{% if currentValue == optValue %} active{% endif %}">{% set lblParts = (optLabels[loop.index0]|default(optValue))|split("\n") %}{% for lp in lblParts %}{% if not loop.first %}<br>{% endif %}{{ gT(lp) }}{% endfor %}</label>
{% endfor %}
{% if bInherit %}
<input id="{{ key }}_inherit" type="radio" name="{{ key }}" value="inherit"