Fix highlight for Python3
This commit is contained in:
@@ -38,6 +38,8 @@ def highlight(html: str) -> str:
|
|||||||
lexer = guess_lexer(code_content)
|
lexer = guess_lexer(code_content)
|
||||||
|
|
||||||
# Replace the code with Pygment output
|
# Replace the code with Pygment output
|
||||||
|
# XXX: the HTML escaping causes issue with Python type annotations
|
||||||
|
code_content = code_content.replace(") -> ", ") -> ")
|
||||||
code.parent.replaceWith(
|
code.parent.replaceWith(
|
||||||
BeautifulSoup(
|
BeautifulSoup(
|
||||||
phighlight(code_content, lexer, _FORMATTER), "html5lib"
|
phighlight(code_content, lexer, _FORMATTER), "html5lib"
|
||||||
|
Reference in New Issue
Block a user