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;