summaryrefslogtreecommitdiff
path: root/pygments/lexers/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/html.py')
-rw-r--r--pygments/lexers/html.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/pygments/lexers/html.py b/pygments/lexers/html.py
index aab83025..2e29f453 100644
--- a/pygments/lexers/html.py
+++ b/pygments/lexers/html.py
@@ -42,7 +42,7 @@ class HtmlLexer(RegexLexer):
('[^<&]+', Text),
(r'&\S*?;', Name.Entity),
(r'\<\!\[CDATA\[.*?\]\]\>', Comment.Preproc),
- ('<!--', Comment, 'comment'),
+ (r'<!--(.|\n)*?-->', Comment.Multiline),
(r'<\?.*?\?>', Comment.Preproc),
('<![^>]*>', Comment.Preproc),
(r'(<)(\s*)(script)(\s*)',
@@ -59,11 +59,6 @@ class HtmlLexer(RegexLexer):
bygroups(Punctuation, Text, Punctuation, Text, Name.Tag, Text,
Punctuation)),
],
- 'comment': [
- ('[^-]+', Comment),
- ('-->', Comment, '#pop'),
- ('-', Comment),
- ],
'tag': [
(r'\s+', Text),
(r'([\w:-]+\s*)(=)(\s*)', bygroups(Name.Attribute, Operator, Text),
@@ -213,18 +208,13 @@ class XmlLexer(RegexLexer):
'root': [
('[^<&]+', Text),
(r'&\S*?;', Name.Entity),
- (r'\<\!\[CDATA\[.*?\]\]\>', Comment.Preproc),
- ('<!--', Comment, 'comment'),
+ (r'\<\!\[CDATA\[.*?\]\]\>', Comment.Preproc),
+ (r'<!--(.|\n)*?-->', Comment.Multiline),
(r'<\?.*?\?>', Comment.Preproc),
('<![^>]*>', Comment.Preproc),
(r'<\s*[\w:.-]+', Name.Tag, 'tag'),
(r'<\s*/\s*[\w:.-]+\s*>', Name.Tag),
],
- 'comment': [
- ('[^-]+', Comment),
- ('-->', Comment, '#pop'),
- ('-', Comment),
- ],
'tag': [
(r'\s+', Text),
(r'[\w.:-]+\s*=', Name.Attribute, 'attr'),