From 54b87ecea87916bd140c0c6197eb203df9992221 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 9 Jun 2019 00:05:32 +0200 Subject: Document in-battle move selection menu scrolling glitch What a mouthful... --- tools/toc.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/toc.py') diff --git a/tools/toc.py b/tools/toc.py index 8ff50be94..13b75ae1c 100755 --- a/tools/toc.py +++ b/tools/toc.py @@ -17,6 +17,7 @@ valid_toc_headings = {'## TOC', '##TOC'} TocItem = namedtuple('TocItem', ['name', 'anchor', 'level']) punctuation_regexp = re.compile(r'[^\w\- ]+') +specialchar_regexp = re.compile(r'[⅔]+') def name_to_anchor(name): # GitHub's algorithm for generating anchors from headings @@ -24,6 +25,7 @@ def name_to_anchor(name): anchor = name.strip().lower() # lowercase anchor = re.sub(punctuation_regexp, '', anchor) # remove punctuation anchor = anchor.replace(' ', '-') # replace spaces with dash + anchor = re.sub(specialchar_regexp, '', anchor) # remove misc special chars return anchor def get_toc_index(lines): -- cgit v1.2.3