summaryrefslogtreecommitdiff
path: root/pygments/lexers/text.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-03-01 13:54:13 +0100
committerGeorg Brandl <georg@python.org>2010-03-01 13:54:13 +0100
commit26a6c4153733225bf484a7da5c3c11956b716889 (patch)
tree49a56192403ac34715b24fc457158daa9c380d91 /pygments/lexers/text.py
parent4063e5de23941be657d24bb6c74e89aa84afda11 (diff)
downloadpygments-26a6c4153733225bf484a7da5c3c11956b716889.tar.gz
Allow fields without body.
Diffstat (limited to 'pygments/lexers/text.py')
-rw-r--r--pygments/lexers/text.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py
index 55b590fe..34a8f424 100644
--- a/pygments/lexers/text.py
+++ b/pygments/lexers/text.py
@@ -679,8 +679,9 @@ class RstLexer(RegexLexer):
# Comments
(r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc),
# Field list
- (r'^( *)(:.*?:)([ \t]+)(.*?)$', bygroups(Text, Name.Class, Text,
- Name.Function)),
+ (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)),
+ (r'^( *)(:.*?:)([ \t]+)(.*?)$',
+ bygroups(Text, Name.Class, Text, Name.Function)),
# Definition list
(r'^([^ ].*(?<!::)\n)((?:(?: +.*)\n)+)',
bygroups(using(this, state='inline'), using(this, state='inline'))),