]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12391 Exclude collapsible block labels from floating TOC
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Thu, 8 Aug 2019 14:44:38 +0000 (16:44 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 20 Aug 2019 18:21:04 +0000 (20:21 +0200)
server/sonar-docs/src/templates/page.tsx

index 9feef164ae3c4df9ed2e4cc6f1ca8851ed98c325..ac170eac2f99ca67f8e1d89c84ef69d904c28f60 100644 (file)
@@ -167,7 +167,14 @@ function replaceDynamicLinks(content: string) {
  */
 function removeExtraHeadings(content: string, headings: MarkdownHeading[]) {
   return headings
-    .filter(heading => content.indexOf(`<div class="collapse"><h2>${heading.value}</h2>`) < 0)
+    .filter(
+      heading =>
+        content.indexOf(
+          `<div class="custom-block collapse"><div class="custom-block-body"><h2>${
+            heading.value
+          }</h2>`
+        ) < 0
+    )
     .filter(heading => !heading.value || !heading.value.match(/Table of content/i))
     .filter(heading => {
       const regex = new RegExp(