Skip to content

Commit 0cb7cd1

Browse files
authored
[BUGFIX] Prevent duplicate escaping of abbreviated defaults (#728)
Generally allow word-breaks in table cells
1 parent d3e625f commit 0cb7cd1

File tree

6 files changed

+54
-5
lines changed

6 files changed

+54
-5
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. include:: /Includes.rst.txt
2+
.. _site_settings:
3+
4+
=============
5+
Site settings
6+
=============
7+
8+
.. literalinclude:: _siteSetSettings.rst.txt
9+
:language: rst
10+
:caption: Settings.rst
11+
12+
.. include:: _siteSetSettings.rst.txt
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. typo3:site-set-settings:: settings.definitions.yaml
2+
:name: my-set
3+
:type:
4+
:Label: max=20
5+
:default: max=10
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
settings:
2+
website.background.color:
3+
label: 'Background color'
4+
description: 'This will validate the given color string'
5+
type: color
6+
default: '#129845'
7+
8+
website.image.lazyLoading:
9+
default: lazy
10+
label: 'Browser-native image lazy loading'
11+
type: string
12+
enum:
13+
lazy: 'Lazy'
14+
eager: 'Eager'
15+
auto: 'Auto'
16+
description: 'Can be "lazy" (browsers could choose to load images later), "eager" (load images right away) or "auto" (browser will determine whether the image should be lazy loaded or not)'
17+
18+
website.rte.allowTags:
19+
default: 'a, abbr, acronym, address, article, aside, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dl, div, dt, em, figure, font, footer, header, h1, h2, h3, h4, h5, h6, hr, i, img, ins, kbd, label, li, link, meta, nav, ol, p, pre, q, s, samp, sdfield, section, small, span, strike, strong, style, sub, sup, table, thead, tbody, tfoot, td, th, tr, title, tt, u, ul, var'
20+
label: 'List of allowed HTML tags when rendering RTE content'
21+
type: string
22+
description: ''

packages/typo3-docs-theme/assets/sass/components/_table.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.table {
2+
td {
3+
word-break: break-word;
4+
}
25
th :last-child,
36
td :last-child {
47
margin-bottom: 0;

packages/typo3-docs-theme/resources/public/css/theme.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24735,6 +24735,9 @@ article *:hover > a.headerlink:after, article *:hover > a.permalink:after, artic
2473524735
padding: 0 !important;
2473624736
}
2473724737

24738+
.table td {
24739+
word-break: break-word;
24740+
}
2473824741
.table th :last-child,
2473924742
.table td :last-child {
2474024743
margin-bottom: 0;

packages/typo3-docs-theme/resources/template/body/directive/confval-menu.html.twig

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,25 @@
116116
{% macro renderFieldContent(content, max) -%}
117117
{%- set rendered_content = renderNode(content) -%}
118118

119+
{# Strip tags but leave entities encoded #}
119120
{%- set stripped_content = rendered_content|striptags -%}
120-
{%- set content_length = stripped_content|length -%}
121+
122+
{# Decode entities to get accurate length #}
123+
{%- set decoded_content = stripped_content|replace({'&quot;': '"', '&amp;': '&', '&lt;': '<', '&gt;': '>'}) -%}
124+
{%- set content_length = decoded_content|length -%}
121125

122126
{# If max is defined and greater than 0, apply truncation #}
123127
{%- if max is defined and max > 0 -%}
124128
{% if content_length > max %}
125-
<span title="{{ stripped_content|raw }}">
126-
{{ stripped_content|slice(0, max)|raw ~ '...' }}
129+
<span title="{{ decoded_content }}">
130+
{{ decoded_content|slice(0, max) ~ '...' }}
127131
</span>
128132
{% else %}
129-
<span>{{ stripped_content|raw }}</span>
133+
<span>{{ decoded_content }}</span>
130134
{% endif %}
131135
{%- else -%}
132136
{{ rendered_content|raw }}
133-
{%- endif -%}
137+
{%- endif %}
134138
{%- endmacro %}
135139

136140
{% macro renderCaption(node) %}

0 commit comments

Comments
 (0)