diff --git a/packages/web-twig/src/Resources/components/Accordion/Accordion.twig b/packages/web-twig/src/Resources/components/Accordion/Accordion.twig index 6c03b6c2cb..d78275feee 100644 --- a/packages/web-twig/src/Resources/components/Accordion/Accordion.twig +++ b/packages/web-twig/src/Resources/components/Accordion/Accordion.twig @@ -7,7 +7,7 @@ {%- set _rootClassName = _spiritClassPrefix ~ 'Accordion' -%} {# Attributes #} -{%- set _idAttr = _id ? 'id=' ~ _id : null -%} +{%- set _idAttr = _id ? 'id="' ~ _id | escape('html_attr') ~ '"' : null -%} {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} @@ -17,7 +17,7 @@ <{{ _elementType }} {{ mainProps(_mainPropsWithoutId) }} {{ styleProp(_styleProps) }} - {{ _idAttr }} + {{ _idAttr | raw }} {{ classProp(_classNames) }} data-toggle="accordion" > diff --git a/packages/web-twig/src/Resources/components/Accordion/AccordionContent.twig b/packages/web-twig/src/Resources/components/Accordion/AccordionContent.twig index 38a1654175..af106b5343 100644 --- a/packages/web-twig/src/Resources/components/Accordion/AccordionContent.twig +++ b/packages/web-twig/src/Resources/components/Accordion/AccordionContent.twig @@ -12,9 +12,9 @@ {%- set _isOpenClassName = _isOpen ? 'is-open' : null -%} {# Attributes #} -{%- set _idAttr = _id ? 'id=' ~ _id : null -%} -{%- set _labelledIdAttr = _labelledById ? 'aria-labelledby=' ~ _labelledById : null -%} -{%- set _dataParentAttr = _parent ? 'data-parent=' ~ _parent : null -%} +{%- set _idAttr = _id ? 'id="' ~ _id | escape('html_attr') ~ '"' : null -%} +{%- set _labelledIdAttr = _labelledById ? 'aria-labelledby="' ~ _labelledById | escape('html_attr') ~ '"' : null -%} +{%- set _dataParentAttr = _parent ? 'data-parent="' ~ _parent | escape('html_attr') ~ '"' : null -%} {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} @@ -25,10 +25,10 @@
diff --git a/packages/web-twig/src/Resources/components/Accordion/AccordionHeader.twig b/packages/web-twig/src/Resources/components/Accordion/AccordionHeader.twig index 18d2208b9b..af8fd9e7b5 100644 --- a/packages/web-twig/src/Resources/components/Accordion/AccordionHeader.twig +++ b/packages/web-twig/src/Resources/components/Accordion/AccordionHeader.twig @@ -14,8 +14,8 @@ {%- set _iconClassName = _spiritClassPrefix ~ 'Accordion__itemIcon' -%} {# Attributes #} -{%- set _idAttr = _id ? 'id=' ~ _id : null -%} -{%- set _dataTargetAttr = _for ? 'data-target=' ~ _for : null -%} +{%- set _idAttr = _id ? 'id="' ~ _id | escape('html_attr') ~ '"' : null -%} +{%- set _dataTargetAttr = _for ? 'data-target="' ~ _for | escape('html_attr') ~ '"' : null -%} {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} @@ -26,14 +26,14 @@ <{{ _elementType }} {{ mainProps(_mainPropsWithoutId) }} {{ styleProp(_styleProps) }} - {{ _idAttr }} + {{ _idAttr | raw }} {{ classProp(_classNames) }} > +
  • - +
  • - Item link + Item link
  • diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textAreaDefault.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textAreaDefault.twig__1.html index fc6d06b949..163c10a5bd 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textAreaDefault.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textAreaDefault.twig__1.html @@ -6,7 +6,7 @@
    - +
    validation failed
    diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldBaseDefault.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldBaseDefault.twig__1.html index b02e76f048..38bde3db59 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldBaseDefault.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldBaseDefault.twig__1.html @@ -5,7 +5,7 @@
    - +
    validation failed
    diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldDefault.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldDefault.twig__1.html index 1fe7695a04..fa4b738337 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldDefault.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldDefault.twig__1.html @@ -5,7 +5,7 @@
    - +
    validation failed
    diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldNotRequired.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldNotRequired.twig__1.html index 57430e5e84..3ad9bdcad1 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldNotRequired.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set textFieldNotRequired.twig__1.html @@ -5,7 +5,7 @@
    - +
    diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefault.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefault.twig__1.html index e2c41e1c7e..49650353a5 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefault.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefault.twig__1.html @@ -5,7 +5,7 @@
    - Hello there!
    diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefaultPure.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefaultPure.twig__1.html index e2c41e1c7e..49650353a5 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefaultPure.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set tooltipDefaultPure.twig__1.html @@ -5,7 +5,7 @@
    - Hello there!
    diff --git a/packages/web-twig/tests/components-fixtures/textFieldBaseDefault.twig b/packages/web-twig/tests/components-fixtures/textFieldBaseDefault.twig index cfd562ce99..2042c25439 100644 --- a/packages/web-twig/tests/components-fixtures/textFieldBaseDefault.twig +++ b/packages/web-twig/tests/components-fixtures/textFieldBaseDefault.twig @@ -1 +1,14 @@ - + diff --git a/packages/web-twig/tests/components-fixtures/textFieldBaseMultiline.twig b/packages/web-twig/tests/components-fixtures/textFieldBaseMultiline.twig index 0c594cbbdf..db1d0746d6 100644 --- a/packages/web-twig/tests/components-fixtures/textFieldBaseMultiline.twig +++ b/packages/web-twig/tests/components-fixtures/textFieldBaseMultiline.twig @@ -1 +1,11 @@ - + diff --git a/packages/web-twig/tests/components-fixtures/textFieldDefault.twig b/packages/web-twig/tests/components-fixtures/textFieldDefault.twig index 330d94806a..5616b698f2 100644 --- a/packages/web-twig/tests/components-fixtures/textFieldDefault.twig +++ b/packages/web-twig/tests/components-fixtures/textFieldDefault.twig @@ -1 +1,12 @@ - +