Skip to content

Commit

Permalink
Merge pull request #3592 from getnikola/revert-pygments-patch
Browse files Browse the repository at this point in the history
Revert "Patch for invalid pygments links (pygments/pygments#2013)"
  • Loading branch information
Kwpolska committed Jan 9, 2022
2 parents 8444457 + 1f0b7a9 commit 2da876e
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions nikola/packages/pygments_better_html/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,3 @@ def format_unencoded(self, tokensource, outfile):

for t, piece in source:
outfile.write(piece)

# FIXME patch for broken code in pygments 2.11.0/2.11.1 - remove when
# Pygments PR #2014 merged
def _wrap_lineanchors(self, inner):
s = self.lineanchors
# subtract 1 since we have to increment i *before* yielding
i = self.linenostart - 1
for t, line in inner:
if t:
i += 1
href = "" if self.linenos else ' href="#%s-%d"' % (s, i)
yield 1, '<a id="%s-%d" name="%s-%d"%s></a>' % (s, i, s, i, href) + line
else:
yield 0, line

0 comments on commit 2da876e

Please sign in to comment.