highlight: get around tmpl.load() which now returns a parsed tree
authorYuya Nishihara <yuya@tcha.org>
Mon, 18 Jun 2018 21:54:52 +0900
changeset 38383 23dc901cdf13
parent 38382 daa08d45740f
child 38384 1d9c97db465f
highlight: get around tmpl.load() which now returns a parsed tree Broken at e637dc0b3b1f, "templater: parse template string to tree by templater class."
hgext/highlight/highlight.py
--- a/hgext/highlight/highlight.py	Sun Jun 17 23:06:20 2018 -0700
+++ b/hgext/highlight/highlight.py	Mon Jun 18 21:54:52 2018 +0900
@@ -44,7 +44,8 @@
 def pygmentize(field, fctx, style, tmpl, guessfilenameonly=False):
 
     # append a <link ...> to the syntax highlighting css
-    old_header = tmpl.load('header')
+    tmpl.load('header')
+    old_header = tmpl.cache['header']
     if SYNTAX_CSS not in old_header:
         new_header = old_header + SYNTAX_CSS
         tmpl.cache['header'] = new_header