ThirdParty/Pygments/pygments/lexers/textfmts.py

changeset 5072
aab59042fefb
parent 4697
c2e9bf425554
child 5713
6762afd9f963
equal deleted inserted replaced
5070:4e4651e88674 5072:aab59042fefb
120 name = 'HTTP' 120 name = 'HTTP'
121 aliases = ['http'] 121 aliases = ['http']
122 122
123 flags = re.DOTALL 123 flags = re.DOTALL
124 124
125 def get_tokens_unprocessed(self, text, stack=('root',)):
126 """Reset the content-type state."""
127 self.content_type = None
128 return RegexLexer.get_tokens_unprocessed(self, text, stack)
129
125 def header_callback(self, match): 130 def header_callback(self, match):
126 if match.group(1).lower() == 'content-type': 131 if match.group(1).lower() == 'content-type':
127 content_type = match.group(5).strip() 132 content_type = match.group(5).strip()
128 if ';' in content_type: 133 if ';' in content_type:
129 content_type = content_type[:content_type.find(';')].strip() 134 content_type = content_type[:content_type.find(';')].strip()

eric ide

mercurial