diff --git a/.changeset/stale-cherries-draw.md b/.changeset/stale-cherries-draw.md new file mode 100644 index 000000000..ddabbc37d --- /dev/null +++ b/.changeset/stale-cherries-draw.md @@ -0,0 +1,5 @@ +--- +"@tabler/docs": patch +--- + +Fix: Exclude headings in the carousel and modal examples from ToC diff --git a/docs/eleventy.config.mjs b/docs/eleventy.config.mjs index 89d59c6df..2ea770b32 100644 --- a/docs/eleventy.config.mjs +++ b/docs/eleventy.config.mjs @@ -226,7 +226,7 @@ export default function (eleventyConfig) { eleventyConfig.addFilter("toc", function (name) { const toc = []; - const contentWithoutExamples = name.replace(/]*\bclass=["'][^"']*\bexample\b[^"']*".*?>.*?<\/div>/gs, ''); + const contentWithoutExamples = name.replace(/[\s\S]*?/g, ''); const headings = contentWithoutExamples.match(/([^<]+)<\/h\1>/g); if (headings) { diff --git a/shared/includes/docs/example.html b/shared/includes/docs/example.html index 55bda49dd..7e97b01aa 100644 --- a/shared/includes/docs/example.html +++ b/shared/includes/docs/example.html @@ -1,3 +1,4 @@ +
{%- unless include.raw -%}
{%- endunless -%} @@ -9,4 +10,5 @@ ```html {{ html }} ``` -{% endunless %} \ No newline at end of file +{% endunless %} + \ No newline at end of file