Mercurial > hg-stable
comparison hgext/highlight/highlight.py @ 38389:23dc901cdf13
highlight: get around tmpl.load() which now returns a parsed tree
Broken at e637dc0b3b1f, "templater: parse template string to tree by
templater class."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 18 Jun 2018 21:54:52 +0900 |
parents | 876352ea831e |
children | a7abc6081bc5 |
comparison
equal
deleted
inserted
replaced
38388:daa08d45740f | 38389:23dc901cdf13 |
---|---|
42 'type="text/css" />') | 42 'type="text/css" />') |
43 | 43 |
44 def pygmentize(field, fctx, style, tmpl, guessfilenameonly=False): | 44 def pygmentize(field, fctx, style, tmpl, guessfilenameonly=False): |
45 | 45 |
46 # append a <link ...> to the syntax highlighting css | 46 # append a <link ...> to the syntax highlighting css |
47 old_header = tmpl.load('header') | 47 tmpl.load('header') |
48 old_header = tmpl.cache['header'] | |
48 if SYNTAX_CSS not in old_header: | 49 if SYNTAX_CSS not in old_header: |
49 new_header = old_header + SYNTAX_CSS | 50 new_header = old_header + SYNTAX_CSS |
50 tmpl.cache['header'] = new_header | 51 tmpl.cache['header'] = new_header |
51 | 52 |
52 text = fctx.data() | 53 text = fctx.data() |