From 9459030d66ac82779917dcf3a330bf982919acd2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 3 Oct 2021 10:41:03 +0200 Subject: [PATCH] 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. --- syntax/yaml.nanorc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntax/yaml.nanorc b/syntax/yaml.nanorc index 6da3cd0a..a8ef08f2 100644 --- 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 "\\."