diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 1ac1cf1..cf3500e 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -84,8 +84,8 @@ public function getFilters() { new \Twig_SimpleFilter('without', 'twig_without'), // CSS class and ID filters. - new \Twig_SimpleFilter('class', 'drupal_html_class'), - new \Twig_SimpleFilter('id', 'drupal_html_id'), + new \Twig_SimpleFilter('clean_class', 'drupal_html_class'), + new \Twig_SimpleFilter('clean_id', 'drupal_clean_id_identifier'), ); } diff --git a/core/modules/system/src/Tests/Theme/TwigFilterTest.php b/core/modules/system/src/Tests/Theme/TwigFilterTest.php index aca4df8..5a285c7 100644 --- a/core/modules/system/src/Tests/Theme/TwigFilterTest.php +++ b/core/modules/system/src/Tests/Theme/TwigFilterTest.php @@ -112,7 +112,7 @@ public function testTwigWithoutFilter() { 'message' => 'All attributes printed again.', ), array( - 'expected' => '
ID and class.
', + 'expected' => '
ID and class. Having the same ID twice is not valid markup but we want to make sure the filter doesn\'t use drupal_html_id().
', 'message' => 'Class and ID filtered.', ), ); diff --git a/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.filter.html.twig b/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.filter.html.twig index 627894a..cc7bc56 100644 --- a/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.filter.html.twig +++ b/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.filter.html.twig @@ -20,4 +20,4 @@
Without string attribute.
Without either nor class attributes.
All attributes again.
-
ID and class.
+
ID and class. Having the same ID twice is not valid markup but we want to make sure the filter doesn't use drupal_html_id().