Show More
@@ -25,10 +25,10 b" The default is 'colorful'." | |||||
25 |
|
25 | |||
26 | import highlight |
|
26 | import highlight | |
27 | from mercurial.hgweb import webcommands, webutil, common |
|
27 | from mercurial.hgweb import webcommands, webutil, common | |
28 | from mercurial import extensions |
|
28 | from mercurial import extensions, encoding | |
29 |
|
29 | |||
30 | def filerevision_highlight(orig, web, tmpl, fctx): |
|
30 | def filerevision_highlight(orig, web, tmpl, fctx): | |
31 |
mt = ''.join(tmpl('mimetype', encoding= |
|
31 | mt = ''.join(tmpl('mimetype', encoding=encoding.encoding)) | |
32 | # only pygmentize for mimetype containing 'html' so we both match |
|
32 | # only pygmentize for mimetype containing 'html' so we both match | |
33 | # 'text/html' and possibly 'application/xhtml+xml' in the future |
|
33 | # 'text/html' and possibly 'application/xhtml+xml' in the future | |
34 | # so that we don't have to touch the extension when the mimetype |
|
34 | # so that we don't have to touch the extension when the mimetype | |
@@ -42,7 +42,7 b' def filerevision_highlight(orig, web, tm' | |||||
42 | return orig(web, tmpl, fctx) |
|
42 | return orig(web, tmpl, fctx) | |
43 |
|
43 | |||
44 | def annotate_highlight(orig, web, req, tmpl): |
|
44 | def annotate_highlight(orig, web, req, tmpl): | |
45 |
mt = ''.join(tmpl('mimetype', encoding= |
|
45 | mt = ''.join(tmpl('mimetype', encoding=encoding.encoding)) | |
46 | if 'html' in mt: |
|
46 | if 'html' in mt: | |
47 | fctx = webutil.filectx(web.repo, req) |
|
47 | fctx = webutil.filectx(web.repo, req) | |
48 | style = web.config('web', 'pygments_style', 'colorful') |
|
48 | style = web.config('web', 'pygments_style', 'colorful') |
General Comments 0
You need to be logged in to leave comments.
Login now