summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Jain <gaurav@gauravjain.org>2014-04-26 11:58:43 -0400
committerGaurav Jain <gaurav@gauravjain.org>2014-04-26 11:58:43 -0400
commit7bd577685544b0f3f27c030fb8feb1757aa76dd3 (patch)
tree0e27e3683ad8ceabd4cf2eef017302f7d7adbd27
parent58976069631aaa0dd6d97f75dbddbdd074082cd6 (diff)
downloadpygments-7bd577685544b0f3f27c030fb8feb1757aa76dd3.tar.gz
ColdFusion: Add Support for nested comments
-rw-r--r--pygments/lexers/templates.py7
-rw-r--r--tests/examplefiles/demo.cfm7
2 files changed, 13 insertions, 1 deletions
diff --git a/pygments/lexers/templates.py b/pygments/lexers/templates.py
index d06ea288..a592c3e5 100644
--- a/pygments/lexers/templates.py
+++ b/pygments/lexers/templates.py
@@ -1534,7 +1534,7 @@ class ColdfusionMarkupLexer(RegexLexer):
(r'<[^<>]*', Other),
],
'tags': [
- (r'(?s)<!---.*?--->', Comment.Multiline),
+ (r'<!---', Comment.Multiline, 'cfcomment'),
(r'(?s)<!--.*?-->', Comment),
(r'<cfoutput.*?>', Name.Builtin, 'cfoutput'),
(r'(?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)',
@@ -1556,6 +1556,11 @@ class ColdfusionMarkupLexer(RegexLexer):
(r'(?s)<[^<>]*', Other),
(r'#', Other),
],
+ 'cfcomment': [
+ (r'<!---', Comment.Multiline, '#push'),
+ (r'--->', Comment.Multiline, '#pop'),
+ (r'(?s).', Comment.Multiline),
+ ],
}
diff --git a/tests/examplefiles/demo.cfm b/tests/examplefiles/demo.cfm
index f52901ce..49690484 100644
--- a/tests/examplefiles/demo.cfm
+++ b/tests/examplefiles/demo.cfm
@@ -1,4 +1,11 @@
<!--- cfcomment --->
+<!--- nested <!--- cfcomment ---> --->
+<!--- multi-line
+nested
+<!---
+cfcomment
+--->
+--->
<!-- html comment -->
<html>
<head>