diff --git a/core/modules/filter/src/Element/TextFormat.php b/core/modules/filter/src/Element/TextFormat.php
index aaff8b4..4b213d8 100644
--- a/core/modules/filter/src/Element/TextFormat.php
+++ b/core/modules/filter/src/Element/TextFormat.php
@@ -161,7 +161,7 @@ public static function processFormat(&$element, FormStateInterface $form_state,
     $options = array();
     foreach ($formats as $format) {
       $options[$format->id()] = $format->label();
-      $element['format']['guidelines'][$format->id()] = array(
+      $element['format']['guidelines']['format-' . $format->id()] = array(
         '#theme' => 'filter_guidelines',
         '#format' => $format,
       );
diff --git a/core/modules/filter/src/Tests/TextFormatElementFormTest.php b/core/modules/filter/src/Tests/TextFormatElementFormTest.php
index b889c4a..2851e34 100644
--- a/core/modules/filter/src/Tests/TextFormatElementFormTest.php
+++ b/core/modules/filter/src/Tests/TextFormatElementFormTest.php
@@ -117,10 +117,16 @@ public function testTextFormatElement() {
     $output = $this->render($form);
     $this->setRawContent($output);
     $this->assertFieldByName('textformat[value]');
-    $this->assertRaw('<h4>Full HTML</h4>');
-    $this->assertRaw('<h4>Filtered HTML</h4>');
-    $this->assertRaw('<h4>Test format</h4>');
+    $this->assertRaw('<h4 class="label">Full HTML</h4>');
+    $this->assertRaw('<h4 class="label">Filtered HTML</h4>');
+    $this->assertRaw('<h4 class="label">Test format</h4>');
     $this->assertNoPattern('|<h4[^>]*></h4>|', 'No empty H4 element found.');
+
+    // It tests if guidelines are included.
+    $this->assertRaw('filter-guidelines-full_html');
+    $this->assertRaw('filter-guidelines-filtered_html');
+    $this->assertRaw('filter-guidelines-filter_test');
+    
   }
 
   /**
diff --git a/core/modules/filter/templates/filter-caption.html.twig b/core/modules/filter/templates/filter-caption.html.twig
index f015ac0..eb9d248 100644
--- a/core/modules/filter/templates/filter-caption.html.twig
+++ b/core/modules/filter/templates/filter-caption.html.twig
@@ -12,7 +12,7 @@
  * - string classes: The classes of the captioned HTML tag.
  */
 #}
-<figure{%- if classes %} class="{{ classes }}"{%- endif %}>
+<figure class="caption caption-{{ tag }}{%- if classes %} {{ classes }}{%- endif %}">
 {{ node }}
 <figcaption>{{ caption }}</figcaption>
 </figure>
diff --git a/core/modules/filter/templates/filter-guidelines.html.twig b/core/modules/filter/templates/filter-guidelines.html.twig
index 317cfa6..9459c1a 100644
--- a/core/modules/filter/templates/filter-guidelines.html.twig
+++ b/core/modules/filter/templates/filter-guidelines.html.twig
@@ -19,7 +19,13 @@
  * @ingroup themeable
  */
 #}
-<div{{ attributes }}>
-  <h4>{{ format.label }}</h4>
+{%
+  set classes = [
+    'filter-guidelines-item',
+    'filter-guidelines-' ~ format.id,
+  ]
+%}
+<div{{ attributes.addClass(classes) }}>
+  <h4 class="label">{{ format.label }}</h4>
   {{ tips }}
 </div>
diff --git a/core/modules/filter/templates/filter-tips.html.twig b/core/modules/filter/templates/filter-tips.html.twig
index b020c23..b17de01 100644
--- a/core/modules/filter/templates/filter-tips.html.twig
+++ b/core/modules/filter/templates/filter-tips.html.twig
@@ -24,19 +24,30 @@
 
 {% if tips|length %}
   {% if multiple %}
-    <div>
+    <div class="compose-tips">
   {% endif %}
 
   {% for name, tip in tips %}
     {% if multiple %}
-      <div{{ attributes }}>
+      {%
+        set tip_classes = [
+          'filter-type',
+          'filter-' ~ name|clean_class,
+        ]
+      %}
+      <div{{ tip.attributes.addClass(tip_classes) }}>
       <h3>{{ tip.name }}</h3>
     {% endif %}
 
     {% if tip.list|length %}
-      <ul>
+      <ul class="tips">
       {% for item in tip.list %}
-        <li{{ tip.attributes }}>{{ item.tip }}</li>
+        {%
+          set item_classes = [
+            long ? 'filter-' ~ item.id|replace({'/': '-'}),
+          ]
+        %}
+        <li{{ item.attributes.addClass(item_classes) }}>{{ item.tip }}</li>
       {% endfor %}
       </ul>
     {% endif %}
diff --git a/core/modules/filter/templates/text-format-wrapper.html.twig b/core/modules/filter/templates/text-format-wrapper.html.twig
index ce3ba55..4e5ff6d 100644
--- a/core/modules/filter/templates/text-format-wrapper.html.twig
+++ b/core/modules/filter/templates/text-format-wrapper.html.twig
@@ -15,9 +15,14 @@
  * @ingroup themeable
  */
 #}
-<div>
+<div class="text-format-wrapper form-item">
   {{ children }}
   {% if description %}
-    <div{{ attributes }}>{{ description }}</div>
+    {%
+      set classes = [
+        aria_description ? 'description',
+      ]
+    %}
+    <div{{ attributes.addClass(classes) }}>{{ description }}</div>
   {% endif %}
 </div>
diff --git a/core/themes/classy/templates/filter/filter-guidelines.html.twig b/core/themes/classy/templates/filter/filter-guidelines.html.twig
index 783992b..9459c1a 100644
--- a/core/themes/classy/templates/filter/filter-guidelines.html.twig
+++ b/core/themes/classy/templates/filter/filter-guidelines.html.twig
@@ -22,7 +22,7 @@
 {%
   set classes = [
     'filter-guidelines-item',
-    'filter-guidelines-' ~ format.format,
+    'filter-guidelines-' ~ format.id,
   ]
 %}
 <div{{ attributes.addClass(classes) }}>
