Attempt to fix links in the table of contents

This commit is contained in:
Zach Borboa
2024-08-24 13:35:48 -04:00
parent bbcbb72c9e
commit 357d1201a0
2 changed files with 10 additions and 9 deletions
+8 -8
View File
@@ -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)
---
+2 -1
View File
@@ -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);