diff options
author | Georg Brandl <georg@python.org> | 2014-10-21 21:33:21 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-21 21:33:21 +0200 |
commit | 8aa58e2c23026d2a5ad5c2112d791d1e73b68a01 (patch) | |
tree | 3d870d79b17b6e18dfbbdd2682f9d3fb3a1e1d20 /pygments/lexers/textfmts.py | |
parent | 732cbdd25dd0b6abfd23e11ff77a158d29f73d56 (diff) | |
download | pygments-8aa58e2c23026d2a5ad5c2112d791d1e73b68a01.tar.gz |
add a analyse_text to the http lexer
Diffstat (limited to 'pygments/lexers/textfmts.py')
-rw-r--r-- | pygments/lexers/textfmts.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py index 813409f3..189d334a 100644 --- a/pygments/lexers/textfmts.py +++ b/pygments/lexers/textfmts.py @@ -187,6 +187,10 @@ class HttpLexer(RegexLexer): ] } + def analyse_text(text): + return text.startswith(('GET /', 'POST /', 'PUT /', 'DELETE /', 'HEAD /', + 'OPTIONS /', 'TRACE /', 'PATCH /')) + class TodotxtLexer(RegexLexer): """ |