You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
urlencode special characters like 'é' in documentation link anchors (#976)
This commit is contained in:
committed by
GitHub
parent
d9dbc13701
commit
78d93a6246
@@ -12,6 +12,7 @@ Headings must start with "##" signs to be detected.
|
||||
import sys
|
||||
import re
|
||||
from collections import namedtuple
|
||||
from urllib.parse import quote
|
||||
|
||||
toc_name = 'Contents'
|
||||
valid_toc_headings = {'## TOC', '##TOC'}
|
||||
@@ -27,6 +28,7 @@ def name_to_anchor(name):
|
||||
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
|
||||
anchor = quote(anchor) # url encode
|
||||
return anchor
|
||||
|
||||
def get_toc_index(lines):
|
||||
|
Reference in New Issue
Block a user