Skip to content

Commit

Permalink
1.6.1dev: pass a list of CSS selectors to `HtmlFormatter.get_style_de…
Browse files Browse the repository at this point in the history
…fs()` of Pygments rather than invoking the method twice

git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.6-stable@17876 af82e41b-90c4-0310-8c96-b1721e28e2e2
  • Loading branch information
jomae committed Feb 5, 2025
1 parent bf368d7 commit 716c02a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions trac/mimeview/pygments.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,8 @@ def process_request(self, req):
return

formatter = HtmlFormatter(style=style_cls)
content = '\n\n'.join([
formatter.get_style_defs('div.code pre'),
formatter.get_style_defs('table.code td')
]).encode('utf-8')
content = formatter.get_style_defs(['div.code pre', 'table.code td'])
content = content.encode('utf-8')

req.send_response(200)
req.send_header('Content-Type', 'text/css; charset=utf-8')
Expand Down

0 comments on commit 716c02a

Please sign in to comment.