summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGreg Dubicki <grzegorz.dubicki@gmail.com>2022-11-14 11:29:22 +0000
committerGeorg Brandl <georg@python.org>2022-11-14 14:59:14 +0100
commit9aa5fc0185a6c8fa82337af02ebc78dbed90dac8 (patch)
tree9a8a0b1b434450436c25bb8e56b4ac3b466fa291 /pygments
parent8abbd68251af1c551daed8d5ffafb14d2e95d9a8 (diff)
downloadpygments-git-9aa5fc0185a6c8fa82337af02ebc78dbed90dac8.tar.gz
Accept colon(s) in YAML key names
as it's ok according to the YAML specs and is widely used in the real world, f.e. in Puppet's Hiera (https://puppet.com/docs/puppet/7/hiera_quick.html#values_common_data)
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/data.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/data.py b/pygments/lexers/data.py
index e7d0a843..d1887304 100644
--- a/pygments/lexers/data.py
+++ b/pygments/lexers/data.py
@@ -231,7 +231,7 @@ class YamlLexer(ExtendedRegexLexer):
# whitespaces separating tokens
(r'[ ]+', Whitespace),
# key with colon
- (r'''([^#,:?\[\]{}"'\n]+)(:)(?=[ ]|$)''',
+ (r'''([^#,?\[\]{}"'\n]+)(:)(?=[ ]|$)''',
bygroups(Name.Tag, set_indent(Punctuation, implicit=True))),
# tags, anchors and aliases,
include('descriptors'),