Commit Graph

14 Commits

Author SHA1 Message Date
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Brendan Cully
4ef0063f6e highlight: forgot import 2008-02-29 14:48:21 -08:00
Brendan Cully
1ba6154655 highlight: guess by text when path name is ambiguous
Although the docs claim that guess_lexer_for_filename will fall back
to using file data, my ubuntu 7.10 pygments library seems to ignore
the text argument. So call guess_lexer explicitly on failure.
2008-02-29 14:47:07 -08:00
Brendan Cully
8d21038955 highlight: make div trimmer work when lexer fails to identify text.
In this case, there is no initial <span> tag.
2008-02-29 14:21:15 -08:00
Brendan Cully
bb081ab6da highlight: use iter() instead of generator comprehension 2008-02-29 11:13:50 -08:00
Brendan Cully
7978fadb5b highlight: bail out if file is binary 2008-02-28 22:04:22 -08:00
Brendan Cully
c74bac600d highlight: support annotate, and reduce layering violations. 2008-02-28 21:35:27 -08:00
Christian Ebert
b5f8d75c94 highlight: update according to latest hgweb_mod changes
Also move encoding workaround completely into non binary condition.
2008-01-31 13:57:48 +01:00
Christian Ebert
7241bd8d3a highlight: fix more tracebacks by forcing util._encoding to hgweb.encoding
This is needed in case util._encoding and hgweb.encoding conflict.
Extreme example:
HGENCODING=UTF-8
[web]
encoding = ascii

Note:
display of files whose encoding differs from HGENCODING or hgweb.encoding
behaves not exactly the same way as with highlight turned off as replacement
chars are either converted or replaced.
2007-12-19 10:11:32 +01:00
Christian Ebert
ad0a9d7201 highlight: pass encoding to lexers and formatter
Try to avoid UnicodeDecodeError by:
- encoding to local
- passing util._encoding as lexer input encoding
- passing hgweb.encoding as formatter output encoding
2007-12-12 14:44:59 +01:00
Christian Ebert
afae160a50 highlight: mandatory arguments where possible 2007-12-12 14:36:34 +01:00
Christian Ebert
6965f3c58c highlight: adapt to hgweb_mode refactoring 2007-12-05 12:48:33 +01:00
Bryan O'Sullivan
e906d6af4e highlight: clean up coding style a little 2007-11-12 10:49:26 -08:00
Adam Hupp
8fafdc321a extension for synax highlighting in the hgweb file revision view
Depends on the pygments syntax highlighting library:
http://pygments.org/
2007-11-10 17:54:57 -05:00