diff options
author | Georg Brandl <georg@python.org> | 2010-03-01 13:54:13 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-03-01 13:54:13 +0100 |
commit | 26a6c4153733225bf484a7da5c3c11956b716889 (patch) | |
tree | 49a56192403ac34715b24fc457158daa9c380d91 /pygments/lexers/text.py | |
parent | 4063e5de23941be657d24bb6c74e89aa84afda11 (diff) | |
download | pygments-26a6c4153733225bf484a7da5c3c11956b716889.tar.gz |
Allow fields without body.
Diffstat (limited to 'pygments/lexers/text.py')
-rw-r--r-- | pygments/lexers/text.py | 5 |
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'))), |