diff options
author | Eric Knibbe <enk3@outlook.com> | 2019-11-25 13:53:34 -0500 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2019-11-27 06:28:48 +0100 |
commit | 1d5f36e04b4cc0f8dddc62823b6a92de78847883 (patch) | |
tree | 04486a183999b3d6658bc6226af44a561e1bd164 | |
parent | 49e562a0c40e3619bb03c78c832c2a93ea5d94e3 (diff) | |
download | pygments-git-1d5f36e04b4cc0f8dddc62823b6a92de78847883.tar.gz |
reStructuredText: highlight only field list markers
-rw-r--r-- | pygments/lexers/markup.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pygments/lexers/markup.py b/pygments/lexers/markup.py index 2eb669e4..ad2491ad 100644 --- a/pygments/lexers/markup.py +++ b/pygments/lexers/markup.py @@ -222,10 +222,9 @@ class RstLexer(RegexLexer): Punctuation, Text, using(this, state='inline'))), # Comments (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc), - # Field list - (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)), - (r'^( *)(:.*?:)([ \t]+)(.*?)$', - bygroups(Text, Name.Class, Text, Name.Function)), + # Field list marker + (r'^( *)(:(?:\\\\|\\:|[^:\n])+:(?=\s))([ \t]*)', + bygroups(Text, Name.Class, Text)), # Definition list (r'^(\S.*(?<!::)\n)((?:(?: +.*)\n)+)', bygroups(using(this, state='inline'), using(this, state='inline'))), |