From 42d75e3a6e66b334ca701a866c0517dcec8b0118 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 3 Jan 2015 19:05:03 -0800 Subject: Improved js regex for html comments. Closes #263. Note, this only affects inline comments. With block comments we parse differently, and don't guarantee that only valid HTML5 comments will pass. This all needs to be made more explicit in the spec. However, this fix addresses the cpu problem. --- js/lib/inlines.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/lib/inlines.js b/js/lib/inlines.js index e97ea5d..2df3630 100644 --- a/js/lib/inlines.js +++ b/js/lib/inlines.js @@ -33,7 +33,7 @@ var ATTRIBUTEVALUESPEC = "(?:" + "\\s*=" + "\\s*" + ATTRIBUTEVALUE + ")"; var ATTRIBUTE = "(?:" + "\\s+" + ATTRIBUTENAME + ATTRIBUTEVALUESPEC + "?)"; var OPENTAG = "<" + TAGNAME + ATTRIBUTE + "*" + "\\s*/?>"; var CLOSETAG = "]"; -var HTMLCOMMENT = ""; +var HTMLCOMMENT = "|"; var PROCESSINGINSTRUCTION = "[<][?].*?[?][>]"; var DECLARATION = "]*>"; var CDATA = "])*\\]\\]>"; -- cgit v1.2.3