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:
parent
e332b4710a
commit
d8bf07535c
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user