From d27682a37fa33a7791d98f5f1abc341e97d10fcd Mon Sep 17 00:00:00 2001 From: Mark Hamstra Date: Tue, 16 Mar 2021 19:24:35 +0100 Subject: [PATCH] Add data-nosnippet to the heading links (fixes #112) --- src/Helpers/MarkupFixer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Helpers/MarkupFixer.php b/src/Helpers/MarkupFixer.php index 9ddba8b9..b6c32068 100644 --- a/src/Helpers/MarkupFixer.php +++ b/src/Helpers/MarkupFixer.php @@ -74,6 +74,7 @@ public function fix(string $markup, int $topLevel = 1, int $depth = 6): string $link = $domDocument->createElement('a'); $link->setAttribute('href', '#' . $node->getAttribute('id')); $link->setAttribute('class', 'heading-link'); + $link->setAttribute('data-nosnippet', 'true'); $link->textContent = 'ΒΆ'; $node->appendChild($link); }