Fix fix_links.py (#4711)

Autolinks were getting discarded when lowercasing anchors, oops.
This commit is contained in:
leo60228 2024-06-03 14:39:25 -04:00 committed by GitHub
parent e925c51391
commit 9fc2132293
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,7 +36,7 @@ def proc_items(items):
s = s.replace('](README.md)', '](./)') s = s.replace('](README.md)', '](./)')
s = s.replace('](/INSTALL.md', '](INSTALL.md') s = s.replace('](/INSTALL.md', '](INSTALL.md')
s = s.replace('](docs/', '](') s = s.replace('](docs/', '](')
item['Chapter']['content'] = URL_RE.sub(handle_url, s) s = URL_RE.sub(handle_url, s)
item['Chapter']['content'] = ANCHOR_RE.sub(handle_anchor, s) item['Chapter']['content'] = ANCHOR_RE.sub(handle_anchor, s)
proc_items(item['Chapter']['sub_items']) proc_items(item['Chapter']['sub_items'])