summaryrefslogtreecommitdiff
path: root/pygments/lexers/text.py
diff options
context:
space:
mode:
authorHong Minhee <minhee@dahlia.kr>2012-08-14 00:40:51 +0900
committerHong Minhee <minhee@dahlia.kr>2012-08-14 00:40:51 +0900
commitddfda9a7d1210629c7d10d92ac527aec1cc79316 (patch)
treee67a0efd83a001189c445d8e6a47dd78e7504dea /pygments/lexers/text.py
parente6bb1ee5b4ebec9fc4c000bf1a25757c3f63ff24 (diff)
downloadpygments-ddfda9a7d1210629c7d10d92ac527aec1cc79316.tar.gz
Handle continuous header lines (HttpLexer)
Diffstat (limited to 'pygments/lexers/text.py')
-rw-r--r--pygments/lexers/text.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py
index 130ddba9..ec69337c 100644
--- a/pygments/lexers/text.py
+++ b/pygments/lexers/text.py
@@ -1643,6 +1643,11 @@ class HttpLexer(RegexLexer):
yield match.start(5), Literal, match.group(5)
yield match.start(6), Text, match.group(6)
+ def continuous_header_callback(self, match):
+ yield match.start(1), Text, match.group(1)
+ yield match.start(2), Literal, match.group(2)
+ yield match.start(3), Text, match.group(3)
+
def content_callback(self, match):
content_type = getattr(self, 'content_type', None)
content = match.group()
@@ -1673,6 +1678,7 @@ class HttpLexer(RegexLexer):
],
'headers': [
(r'([^\s:]+)( *)(:)( *)([^\r\n]+)(\r?\n|$)', header_callback),
+ (r'([\t ]+)([^\r\n]+)(\r?\n|$)', continuous_header_callback),
(r'\r?\n', Text, 'content')
],
'content': [