From e8d9b87ced1123c0257268775a0c24b5ea4049c5 Mon Sep 17 00:00:00 2001 From: Igor V Belousov Date: Wed, 4 Feb 2015 13:31:48 +0300 Subject: [PATCH] modified: src/MarkupFixer.php --- src/MarkupFixer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MarkupFixer.php b/src/MarkupFixer.php index 46f7eef..c0477b1 100644 --- a/src/MarkupFixer.php +++ b/src/MarkupFixer.php @@ -8,6 +8,7 @@ * @version 1.0 * @package caseyamcl/toc * @author Casey McLaughlin + * @author Igor V Belouosv * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -80,7 +81,9 @@ class MarkupFixer continue; } - $tag->id = $sluggifier->slugify($tag->title ?: $tag->plaintext); + $tag->id = preg_replace('/^[-0-9._:]+/', '', + $sluggifier->slugify($tag->title ?: $tag->plaintext) + ); } return (string) $parsed;