Skip to content

Commit 17b3ba2

Browse files
committed
Fix TOC generation
1 parent c6b9922 commit 17b3ba2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/Knowledge-Base.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Table of contents:
1010
* [How to capture Audio and Video in HTML5?](#how-to-capture-audio-and-video-in-html5)
1111
* [Touch and multi-touch support](#touch-and-multi-touch-support)
1212
* [Black or white browser screen](#black-or-white-browser-screen)
13-
* [Python crashes with "Segmentation fault" - how to debug?](#python-crashes-with-segmentation-fault-how-to-debug)
13+
* [How to enable debug information in examples?](#how-to-enable-debug-information-in-examples)
14+
* [Python crashes with "Segmentation fault" - how to debug?](#python-crashes-with-segmentation-fault---how-to-debug)
1415
* [Windows XP support](#windows-xp-support)
1516
* [Mac 32-bit support](#mac-32-bit-support)
1617
* [Security](#security)

tools/toc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,12 @@ def parse_headings(raw_contents, file_):
160160
def headinghash(title):
161161
"""Get a link hash for a heading H1,H2,H3."""
162162
hash_ = title.lower()
163+
hash_ = hash_.replace(" - ", "specialcase1")
163164
hash_ = re.sub(r"[^a-z0-9_\- ]+", r"", hash_)
164165
hash_ = hash_.replace(" ", "-")
165166
hash_ = re.sub(r"[-]+", r"-", hash_)
166167
hash_ = re.sub(r"-$", r"", hash_)
168+
hash_ = hash_.replace("specialcase1", "---")
167169
return hash_
168170

169171

0 commit comments

Comments
 (0)