Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b10273 commit c66df17Copy full SHA for c66df17
pygments/lexers/textfmts.py
@@ -194,8 +194,13 @@ def content_callback(self, match):
194
}
195
196
def analyse_text(text):
197
- return re.search(r'^([a-zA-Z][-_a-zA-Z]+)( +)([^ ]+)( +)'
198
- r'(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)', text) is not None
+ return any (
+ re.search(pattern, text) is not None
199
+ for pattern in (
200
+ r'^([a-zA-Z][-_a-zA-Z]+)( +)([^ ]+)( +)(HTTP)(/)(1\.[01]|2(?:\.0)?|3)(\r?\n|\Z)',
201
+ r'^(HTTP)(/)(1\.[01]|2(?:\.0)?|3)( +)(\d{3})(?:( +)([^\r\n]*))?(\r?\n|\Z)',
202
+ )
203
204
205
206
class TodotxtLexer(RegexLexer):
0 commit comments