commit 9459030d66ac82779917dcf3a330bf982919acd2
parent f5457356386b2cf2716b8ce4de6c502ea7329113
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 3 Oct 2021 10:41:03 +0200
syntax: yaml: allow any character in tags except whitespace
This will colorize also invalid tags, but the rules are too complicated
to catch in a simple regex.
See https://yaml.org/spec/1.2.2/#691-node-tags.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/syntax/yaml.nanorc b/syntax/yaml.nanorc
@@ -22,7 +22,7 @@ color normal "[:,]( |$)"
color lightmagenta " [12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
color lightmagenta "("([^"]|\\")+"|'[^']+')"
-# Anchors and references:
+# Anchors and aliases:
color pink " [&*](\w|-)+( |$)"
# Symbols:
@@ -32,9 +32,9 @@ color bold,yellow "^ *(\?|([?:] +)?-) "
color yellow "[]{}[]"
color normal "^ *: "
-# Types:
+# Tags:
color mint " !!(binary|bool|float|int|map|null|omap|seq|set|str)( |$)"
-color mint " !(\w|-)+( |$)"
+color mint " ![^ ]+( |$)"
# Escaped characters (first color all as bad, then recolor the good ones):
color lightwhite,red "\\."