From ab62d28817ed7ba46aa04113aa9b99f0fe827d9d Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 25 Dec 2017 15:25:04 +0100 Subject: [PATCH] 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. --- syntax/javascript.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/javascript.nanorc b/syntax/javascript.nanorc index 4324450d..15d63f12 100644 --- 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.