mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Fix highlight for Python3
This commit is contained in:
parent
4c23d2b984
commit
7d760ecf58
1 changed files with 2 additions and 0 deletions
|
@ -38,6 +38,8 @@ def highlight(html: str) -> str:
|
|||
lexer = guess_lexer(code_content)
|
||||
|
||||
# Replace the code with Pygment output
|
||||
# XXX: the HTML escaping causes issue with Python type annotations
|
||||
code_content = code_content.replace(") -> ", ") -> ")
|
||||
code.parent.replaceWith(
|
||||
BeautifulSoup(
|
||||
phighlight(code_content, lexer, _FORMATTER), "html5lib"
|
||||
|
|
Loading…
Reference in a new issue