diff options
| author | Felix Fontein <felix@fontein.de> | 2019-01-12 17:01:52 +0100 |
|---|---|---|
| committer | Felix Fontein <felix@fontein.de> | 2019-01-12 17:01:52 +0100 |
| commit | aa7c8ba4e40a5657e2c9aa0b8dccaf9d193390ff (patch) | |
| tree | 9ea68628eff78dea5a63affc4f49ca52e1c17ee0 | |
| parent | 46bc0596f084b4162c85c8275be6946d23202bf9 (diff) | |
| download | pygments-git-aa7c8ba4e40a5657e2c9aa0b8dccaf9d193390ff.tar.gz | |
Improve YAML mapping lexing: fix problems with quoted colons.
| -rw-r--r-- | pygments/lexers/data.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/lexers/data.py b/pygments/lexers/data.py index a67d084e..7593b487 100644 --- a/pygments/lexers/data.py +++ b/pygments/lexers/data.py @@ -233,7 +233,7 @@ class YamlLexer(ExtendedRegexLexer): # whitespaces separating tokens (r'[ ]+', Text), # key with colon - (r'([^,:?\[\]{}\n]+)(:)(?=[ ]|$)', + (r'''([^,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''', bygroups(Name.Tag, set_indent(Punctuation, implicit=True))), # tags, anchors and aliases, include('descriptors'), @@ -312,7 +312,7 @@ class YamlLexer(ExtendedRegexLexer): # a flow mapping indicated by '{' and '}' 'flow-mapping': [ # key with colon - (r'([^,:?\[\]{}\n]+)(:)(?=[ ]|$)', + (r'''([^,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''', bygroups(Name.Tag, Punctuation)), # include flow collection rules include('flow-collection'), |
