diff --git a/tildes/requirements-dev.txt b/tildes/requirements-dev.txt
index 8cd35f1..1634bef 100644
--- a/tildes/requirements-dev.txt
+++ b/tildes/requirements-dev.txt
@@ -66,7 +66,7 @@ pycparser==2.22
pydocstyle==6.3.0
pyflakes==3.4.0
pygit2==1.18.1
-pygments==2.9.0
+pygments==2.19.2
pylint==3.3.8
pylint-celery==0.3
pylint-django==2.6.1
diff --git a/tildes/requirements.in b/tildes/requirements.in
index ebe0016..a7ee0cf 100644
--- a/tildes/requirements.in
+++ b/tildes/requirements.in
@@ -17,7 +17,7 @@ prometheus-client
psycopg2
publicsuffix2==2.20160818
pygit2
-Pygments==2.9.0 # TODO: Upgrade Pygments, new version causes an error on posting a code block
+Pygments
pyotp
pyramid<2.0
pyramid-ipython
diff --git a/tildes/requirements.txt b/tildes/requirements.txt
index 8402774..477544c 100644
--- a/tildes/requirements.txt
+++ b/tildes/requirements.txt
@@ -43,7 +43,7 @@ publicsuffix2==2.20160818
pure-eval==0.2.3
pycparser==2.22
pygit2==1.18.1
-pygments==2.9.0
+pygments==2.19.2
pyotp==2.9.0
pyproject-hooks==1.2.0
pyramid==1.10.8
diff --git a/tildes/tildes/lib/markdown.py b/tildes/tildes/lib/markdown.py
index 3e9d1c7..36d985b 100644
--- a/tildes/tildes/lib/markdown.py
+++ b/tildes/tildes/lib/markdown.py
@@ -255,12 +255,15 @@ class CodeHtmlFormatter(HtmlFormatter):
... instead (assumes a
is already present).
"""
- def wrap(self, source: Any, outfile: Any) -> Iterator[tuple[int, str]]:
+ def wrap(self, source: Any) -> Iterator[tuple[int, str]]:
"""Wrap the highlighted tokens with the tag."""
- # pylint: disable=unused-argument
- yield (0, '')
+ yield 0, ''
yield from source
- yield (0, "")
+ yield 0, ""
+
+ def _wrap_div(self, inner: Any) -> Iterator[tuple[int, str]]:
+ """Override HtmlFormatter to omit the wrapping ."""
+ yield from inner
def apply_syntax_highlighting(html: str) -> str: