summaryrefslogtreecommitdiff
path: root/pygments/lexers/textfmts.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-02 22:17:15 +0100
committerGeorg Brandl <georg@python.org>2016-02-02 22:17:15 +0100
commite59c3bf66fb13a9efc25c3a8e2396804f32ca1e5 (patch)
tree7664ec8263066d1db73d069233e2af5516966181 /pygments/lexers/textfmts.py
parent923fbfedc8467761491d4adeba1f5f00a11239eb (diff)
downloadpygments-e59c3bf66fb13a9efc25c3a8e2396804f32ca1e5.tar.gz
Fixed statefulness of HttpLexer between get_tokens calls
Diffstat (limited to 'pygments/lexers/textfmts.py')
-rw-r--r--pygments/lexers/textfmts.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py
index 43b16f8c..cab9add5 100644
--- a/pygments/lexers/textfmts.py
+++ b/pygments/lexers/textfmts.py
@@ -122,6 +122,11 @@ class HttpLexer(RegexLexer):
flags = re.DOTALL
+ def get_tokens_unprocessed(self, text, stack=('root',)):
+ """Reset the content-type state."""
+ self.content_type = None
+ return RegexLexer.get_tokens_unprocessed(self, text, stack)
+
def header_callback(self, match):
if match.group(1).lower() == 'content-type':
content_type = match.group(5).strip()