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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user