From d0709fea87e2c080b0f6d1f83e72c7fce8678937 Mon Sep 17 00:00:00 2001 From: Ryan Griffith Date: Mon, 22 Apr 2013 11:18:24 -0300 Subject: [PATCH 1/2] Improvement to HTML comments Fixed issue where HTML comments were not properly ending, causing all code after the start comment tag to appear commented out. --- lib/ace/mode/velocity_highlight_rules.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ace/mode/velocity_highlight_rules.js b/lib/ace/mode/velocity_highlight_rules.js index 8d2510e4..2227f769 100644 --- a/lib/ace/mode/velocity_highlight_rules.js +++ b/lib/ace/mode/velocity_highlight_rules.js @@ -133,6 +133,10 @@ var VelocityHighlightRules = function() { token : "comment.block", // closing comment regex : ".*?\\*#", next : "start" + }, { + token : "comment", // closing HTML comment + regex : ".*?-->", + next : "start" }, { token : "comment", // comment spanning whole line regex : ".+" @@ -229,4 +233,4 @@ var VelocityHighlightRules = function() { oop.inherits(VelocityHighlightRules, TextHighlightRules); exports.VelocityHighlightRules = VelocityHighlightRules; -}); \ No newline at end of file +}); From f380abf51cea8638f6302aa8fae91198d265d132 Mon Sep 17 00:00:00 2001 From: Ryan Griffith Date: Fri, 26 Apr 2013 14:57:17 -0400 Subject: [PATCH 2/2] Adjusted to comment section tokens based on recommendation. --- lib/ace/mode/velocity_highlight_rules.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/ace/mode/velocity_highlight_rules.js b/lib/ace/mode/velocity_highlight_rules.js index 2227f769..c675ba7c 100644 --- a/lib/ace/mode/velocity_highlight_rules.js +++ b/lib/ace/mode/velocity_highlight_rules.js @@ -130,16 +130,11 @@ var VelocityHighlightRules = function() { ], "comment" : [ { - token : "comment.block", // closing comment - regex : ".*?\\*#", + token : "comment", // closing comment + regex : "\\*#|-->", next : "start" }, { - token : "comment", // closing HTML comment - regex : ".*?-->", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" + defaultToken: "comment" } ], "vm_start" : [ @@ -233,4 +228,4 @@ var VelocityHighlightRules = function() { oop.inherits(VelocityHighlightRules, TextHighlightRules); exports.VelocityHighlightRules = VelocityHighlightRules; -}); +}); \ No newline at end of file