diff --git a/app/Libraries/Markdown/Osu/DocumentProcessor.php b/app/Libraries/Markdown/Osu/DocumentProcessor.php index cccd53aa6f3..579ec1a65f5 100644 --- a/app/Libraries/Markdown/Osu/DocumentProcessor.php +++ b/app/Libraries/Markdown/Osu/DocumentProcessor.php @@ -148,7 +148,9 @@ private function loadToc() } $title = presence($this->getText($this->node)); - $slug = $this->node->data['attributes']['id'] ?? presence(mb_strtolower(str_replace(' ', '-', $title))) ?? 'page'; + $slug = $this->node->data['attributes']['id'] + ?? presence(mb_strtolower(strtr($title ?? '', ' ', '-'))) + ?? 'page'; if (array_key_exists($slug, $this->tocSlugs)) { $this->tocSlugs[$slug] += 1;