[PATCH] highlight: Only pygmentize for HTML mimetypes

Dirkjan Ochtman dirkjan at ochtman.nl
Thu Sep 4 03:57:36 CDT 2008


Rocco Rutte <pdmef <at> gmx.net> writes:
> - test against "text/html", not just for "html"
> - use stringify() to render template to string

Actually, I'm not sure about these.

For the first, "html" would also match "application/xhtml+xml", which is nice
(and I don't think there's any downside). Maybe change this back and add a
comment about why this is a good thing?

For the second, in crew, templates should always return an iterator over
strings, so I'd prefer just using ''.join() (should be faster, too). Now that
templaters will always only iterate over strings, we should be able to eliminate
most uses of stringify(), which, in my opinion, is a bit of a hack.

Cheers,

Dirkjan



More information about the Mercurial-devel mailing list