Commit Graph

11 Commits

Author SHA1 Message Date
Christian Ebert
5cbc9e210a highlight: convert text to local before passing to pygmentize (issue1341)
Example case:
Display file written in iso-8859-1 with current HGENCODING utf-8.
At the moment only an Error page appears because pygmentize
chokes on the replacement chars.

Alternatives:
1) Turn off highlighting and avoid UnicodeDecodeError
   for files that are not in HGENCODING.
2) [this patch] use util.tolocal to display these files.

Alternative 2) seems ok, as this only concerns display and
readability.

See also: c5f1a58b8b9a, apparently put aside during refactor of
highlight.

Add test for UnicodeDecodeError with iso-8859-1 file contents.
2008-10-17 12:12:33 +02:00
Patrick Mezard
4813e1621f get-with-headers: fix stream modes under Windows 2008-09-28 20:40:38 +02:00
Dirkjan Ochtman
0aa08a7ed8 merge with crew-stable 2008-09-17 11:34:37 +02:00
Dirkjan Ochtman
87abdc361c tests: fix test-highlight for compatiblity with newer Pygments 2008-09-17 11:14:06 +02:00
Rocco Rutte
cc79439de6 highlight: only pygmentize for HTML mimetypes
For non-html mimetypes it doesn't make much sense. This also fixes the
issue that highlight unconditionally adds a <link/> tag for its CSS to
the template's header (which is pointless in text/plain output).
2008-09-05 10:39:57 +02:00
Matt Mackall
09385b3219 Fix up tests 2008-08-18 16:50:36 -05:00
Dirkjan Ochtman
a74c0e9f94 tests: fix test breakage from graph template changes 2008-06-18 11:08:21 +02:00
Dirkjan Ochtman
cd5e863912 hgweb: show cset node and description when hovering over annotate prefix 2008-06-07 17:52:00 +02:00
Dirkjan Ochtman
8b56cfd1ea tests: fix test-highlight output, changed in 7ebbe90114ae 2008-04-24 11:43:54 +02:00
Isaac Jurado
ec51524d45 highlight: Generate pygments style sheet dynamically
This patch allows a per-repository (for example, within a hgwebdir) selection
of pygments_style web option.  No static .css files required.

Test edited by pmezard (compatibility fixes)
2008-04-05 21:29:02 +02:00
Dirkjan Ochtman
a3c9e25c1e tests: add highlight extension tests 2008-03-22 20:16:30 +01:00