commit ab62d28817ed7ba46aa04113aa9b99f0fe827d9d
parent 8e0a7ec20d979f56fb9b9a2beb41bc78bc4a1e23
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 25 Dec 2017 15:25:04 +0100
syntax: javascript: require that a comment is preceded by whitespace
Either by whitespace or by the start of a line.
This avoids treating part of a URL as a comment.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/syntax/javascript.nanorc b/syntax/javascript.nanorc
@@ -13,7 +13,7 @@ color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\
# Strings.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
# Comments.
-color brightblue "//.*"
+color brightblue "(^|[[:space:]])//.*"
color brightblue start="/\*" end="\*/"
# Trailing whitespace.