Browse Source

Update Pygments to 2.19.2 (was 2.9.0)

See merge request tildes/tildes!174
develop-1.101
talklittle 4 weeks ago
parent
commit
4e6eee4da9
  1. 2
      tildes/requirements-dev.txt
  2. 2
      tildes/requirements.in
  3. 2
      tildes/requirements.txt
  4. 11
      tildes/tildes/lib/markdown.py

2
tildes/requirements-dev.txt

@ -78,7 +78,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

2
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

2
tildes/requirements.txt

@ -55,7 +55,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

11
tildes/tildes/lib/markdown.py

@ -255,12 +255,15 @@ class CodeHtmlFormatter(HtmlFormatter):
<code class="highlight">...</code> instead (assumes a <pre> 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 <code> tag."""
# pylint: disable=unused-argument
yield (0, '<code class="highlight">')
yield 0, '<code class="highlight">'
yield from source
yield (0, "</code>")
yield 0, "</code>"
def _wrap_div(self, inner: Any) -> Iterator[tuple[int, str]]:
"""Override HtmlFormatter to omit the wrapping <div class="highlight">."""
yield from inner
def apply_syntax_highlighting(html: str) -> str:

Loading…
Cancel
Save