1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Strip superscripts and divisions from eventual slug

As suggested by @Ayesh

Co-authored-by: Ayesh Karunaratne <ayesh@ayesh.me>
This commit is contained in:
Aidan Woods 2020-05-04 22:37:38 +01:00
parent e332b4710a
commit d8bf07535c
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -24,7 +24,7 @@ final class HeaderSlug implements Configurable
$this->slugCallback = function (string $text): string {
$slug = \mb_strtolower($text);
$slug = \str_replace(' ', '-', $slug);
$slug = \preg_replace('/[^\p{L}\p{N}\p{M}-]+/u', '', $slug);
$slug = \preg_replace('/[^\p{L}\p{Nd}\p{Nl}\p{M}-]+/u', '', $slug);
return $slug;
};