mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-09 13:35:31 +00:00
Fix links in table of contents caused by variation selector-16 (U+FE0F)
This commit is contained in:
@@ -51,7 +51,19 @@ script=$(cat <<'EOF'
|
||||
preg_match_all('/^### (.*)/m', $data, $matches);
|
||||
$toc = [];
|
||||
foreach ($matches['1'] as $match) {
|
||||
$slug = strtolower(preg_replace('/[^A-Za-z-]/', '', str_replace(' ', '-', $match)));
|
||||
$slug = urlencode(
|
||||
strtolower(
|
||||
str_replace(
|
||||
' ',
|
||||
'-',
|
||||
preg_replace(
|
||||
'/[^A-Za-z\x{FE0F} ]/u',
|
||||
'',
|
||||
$match,
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
$href = '#' . $slug;
|
||||
$toc[] = '- [' . $match . '](' . $href . ')';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user