From 357d1201a0a0766d94f0930a34e331959cc6e998 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 24 Aug 2024 13:35:48 -0400 Subject: [PATCH] Attempt to fix links in the table of contents --- README.md | 16 ++++++++-------- scripts/update_readme_methods.sh | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 87eef2c..9a9f0d5 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. --- -- [โš™๏ธ Installation](#โš™๏ธ-installation) -- [๐Ÿ“‹ Requirements](#๐Ÿ“‹-requirements) -- [๐Ÿš€ Quick Start and Examples](#๐Ÿš€-quick-start-and-examples) -- [๐Ÿ“– Available Methods](#๐Ÿ“–-available-methods) -- [๐Ÿ”’ Security](#๐Ÿ”’-security) -- [๐Ÿ› ๏ธ Troubleshooting](#๐Ÿ› ๏ธ-troubleshooting) -- [๐Ÿงช Testing](#๐Ÿงช-testing) -- [๐Ÿค Contributing](#๐Ÿค-contributing) +- [โš™๏ธ Installation](#-installation) +- [๐Ÿ“‹ Requirements](#-requirements) +- [๐Ÿš€ Quick Start and Examples](#-quick-start-and-examples) +- [๐Ÿ“– Available Methods](#-available-methods) +- [๐Ÿ”’ Security](#-security) +- [๐Ÿ› ๏ธ Troubleshooting](#-troubleshooting) +- [๐Ÿงช Testing](#-testing) +- [๐Ÿค Contributing](#-contributing) --- diff --git a/scripts/update_readme_methods.sh b/scripts/update_readme_methods.sh index 485eddf..ff9fa24 100755 --- a/scripts/update_readme_methods.sh +++ b/scripts/update_readme_methods.sh @@ -51,7 +51,8 @@ script=$(cat <<'EOF' preg_match_all('/^### (.*)/m', $data, $matches); $toc = []; foreach ($matches['1'] as $match) { - $href = '#' . str_replace(' ', '-', strtolower($match)); + $slug = strtolower(preg_replace('/[^A-Za-z-]/', '', str_replace(' ', '-', $match))); + $href = '#' . $slug; $toc[] = '- [' . $match . '](' . $href . ')'; } $toc = implode("\n", $toc);