Skip to content

Commit 23194e7

Browse files
authored
[spec] Fix underscores in HTML hrefs (#533)
1 parent fe1abd0 commit 23194e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

document/core/util/mathdef.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
xref_re = re.compile('\\\\xref\{([^}]*)\}\{([^}]*)\}', re.M)
1818

1919
def html_hyperlink(file, id):
20-
return '\\href{../%s.html#%s}' % (file, id)
20+
return '\\href{../%s.html#%s}' % (file, id.replace('_', '-'))
2121

2222
def html_transform_math_xref(node):
2323
node['latex'] = \
@@ -31,7 +31,7 @@ def ext_html_visit_displaymath(self, node):
3131
html_transform_math_xref(node)
3232
html_visit_displaymath(self, node)
3333

34-
# Mirrors sphinx/writer/latex
34+
# Mirrors sphinx/writers/latex
3535
def latex_hyperlink(file, id):
3636
id = text_type(id).translate(tex_replace_map).\
3737
encode('ascii', 'backslashreplace').decode('ascii').\

0 commit comments

Comments
 (0)