Mercurial > hg
changeset 6197:f6565f7d9489
highlight: make div trimmer work when lexer fails to identify text.
In this case, there is no initial <span> tag.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Fri, 29 Feb 2008 14:21:15 -0800 |
parents | fc9535ae6fe2 |
children | 358cc9cf54db |
files | hgext/highlight.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/highlight.py Fri Feb 29 11:13:50 2008 -0800 +++ b/hgext/highlight.py Fri Feb 29 14:21:15 2008 -0800 @@ -72,7 +72,7 @@ colorized = highlight(text, lexer, formatter) # strip wrapping div colorized = colorized[:colorized.find('\n</pre>')] - colorized = colorized[colorized.find('<span'):] + colorized = colorized[colorized.find('<pre>')+5:] coloriter = iter(colorized.splitlines()) filters['colorize'] = lambda x: coloriter.next()