Skip to content

Commit 716c02a

Browse files
author
jomae
committed
1.6.1dev: pass a list of CSS selectors to HtmlFormatter.get_style_defs() 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
1 parent bf368d7 commit 716c02a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

trac/mimeview/pygments.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ def process_request(self, req):
187187
return
188188

189189
formatter = HtmlFormatter(style=style_cls)
190-
content = '\n\n'.join([
191-
formatter.get_style_defs('div.code pre'),
192-
formatter.get_style_defs('table.code td')
193-
]).encode('utf-8')
190+
content = formatter.get_style_defs(['div.code pre', 'table.code td'])
191+
content = content.encode('utf-8')
194192

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

0 commit comments

Comments
 (0)