7982:48d210e41c65 | 7983:54c5cfbb1e29 |
---|---|
3 pygments.lexers.scdoc | 3 pygments.lexers.scdoc |
4 ~~~~~~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~~~~~~ |
5 | 5 |
6 Lexer for scdoc, a simple man page generator. | 6 Lexer for scdoc, a simple man page generator. |
7 | 7 |
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. | 8 :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. | 9 :license: BSD, see LICENSE for details. |
10 """ | 10 """ |
11 | 11 |
12 import re | 12 import re |
13 | 13 |
66 # general text, must come last! | 66 # general text, must come last! |
67 (r'[^\\\s]+', Text), | 67 (r'[^\\\s]+', Text), |
68 (r'.', Text), | 68 (r'.', Text), |
69 ], | 69 ], |
70 } | 70 } |
71 | |
72 def analyse_text(text): | |
73 """This is very similar to markdown, save for the escape characters | |
74 needed for * and _.""" | |
75 result = 0 | |
76 | |
77 if '\\*' in text: | |
78 result += 0.01 | |
79 | |
80 if '\\_' in text: | |
81 result += 0.01 | |
82 | |
83 return result |