diff options
author | Gaurav Jain <gaurav@gauravjain.org> | 2014-04-26 11:58:43 -0400 |
---|---|---|
committer | Gaurav Jain <gaurav@gauravjain.org> | 2014-04-26 11:58:43 -0400 |
commit | 7bd577685544b0f3f27c030fb8feb1757aa76dd3 (patch) | |
tree | 0e27e3683ad8ceabd4cf2eef017302f7d7adbd27 | |
parent | 58976069631aaa0dd6d97f75dbddbdd074082cd6 (diff) | |
download | pygments-7bd577685544b0f3f27c030fb8feb1757aa76dd3.tar.gz |
ColdFusion: Add Support for nested comments
-rw-r--r-- | pygments/lexers/templates.py | 7 | ||||
-rw-r--r-- | tests/examplefiles/demo.cfm | 7 |
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> |