fix(options): render newline in button optionlabels as <br> (Base font size "XLarge / (20 px)")
The fontsize option label "XLarge (20 px)" in config.xml survived XML parsing as a real newline, but gT() html-escapes LF to (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:
parent
02e9babe7c
commit
94a203a133
1 changed files with 7 additions and 2 deletions
|
|
@ -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 ( in config.xml survives
|
||||
XML attribute normalization) renders as a <br>. Split the RAW
|
||||
label first: gT() html-escapes a newline to , 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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue