1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

Fix: Exclude headings in the carousel and modal examples from ToC (#2362)

This commit is contained in:
BG-Software
2025-05-12 22:13:38 +02:00
committed by GitHub
parent 222ddd4b2f
commit 7fc1d5c11c
3 changed files with 9 additions and 2 deletions

View File

@@ -226,7 +226,7 @@ export default function (eleventyConfig) {
eleventyConfig.addFilter("toc", function (name) {
const toc = [];
const contentWithoutExamples = name.replace(/<div[^>]*\bclass=["'][^"']*\bexample\b[^"']*".*?>.*?<\/div>/gs, '');
const contentWithoutExamples = name.replace(/<!--EXAMPLE-->[\s\S]*?<!--\/EXAMPLE-->/g, '');
const headings = contentWithoutExamples.match(/<h([23])>([^<]+)<\/h\1>/g);
if (headings) {