summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2019-01-12 17:01:52 +0100
committerFelix Fontein <felix@fontein.de>2019-01-12 17:01:52 +0100
commitea47446222a927e88e1223e0218c2088baf0bec7 (patch)
tree80a971884d32534042c8c0c8715f6b6fdad1e960
parent867fbbd26114b70d04c5885e1447af1d8acb08df (diff)
downloadpygments-ea47446222a927e88e1223e0218c2088baf0bec7.tar.gz
Improve YAML mapping lexing: fix problems with quoted colons.
-rw-r--r--pygments/lexers/data.py4
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'),