##// END OF EJS Templates
highlight: peek Content-Type header set by hgweb...
Yuya Nishihara -
r37036:3e74d3cc default
parent child Browse files
Show More
@@ -35,7 +35,6 b' from mercurial.hgweb import ('
35 35 )
36 36
37 37 from mercurial import (
38 encoding,
39 38 extensions,
40 39 fileset,
41 40 )
@@ -59,7 +58,7 b' def pygmentize(web, field, fctx, tmpl):'
59 58 guessfilenameonly=filenameonly)
60 59
61 60 def filerevision_highlight(orig, web, fctx):
62 mt = ''.join(web.tmpl('mimetype', encoding=encoding.encoding))
61 mt = web.res.headers['Content-Type']
63 62 # only pygmentize for mimetype containing 'html' so we both match
64 63 # 'text/html' and possibly 'application/xhtml+xml' in the future
65 64 # so that we don't have to touch the extension when the mimetype
@@ -73,7 +72,7 b' def filerevision_highlight(orig, web, fc'
73 72 return orig(web, fctx)
74 73
75 74 def annotate_highlight(orig, web):
76 mt = ''.join(web.tmpl('mimetype', encoding=encoding.encoding))
75 mt = web.res.headers['Content-Type']
77 76 if 'html' in mt:
78 77 fctx = webutil.filectx(web.repo, web.req)
79 78 pygmentize(web, 'annotateline', fctx, web.tmpl)
General Comments 0
You need to be logged in to leave comments. Login now