diff options
author | Georg Brandl <georg@python.org> | 2013-05-19 10:25:27 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-05-19 10:25:27 +0200 |
commit | a494b736786075b087479f6405405d15e1867325 (patch) | |
tree | 095b44995712f769fa3a50acaf0752af789f7966 | |
parent | 341b76c10c27d9a85eb9cd43b544897414f0ad2a (diff) | |
download | pygments-a494b736786075b087479f6405405d15e1867325.tar.gz |
Closes #846: support "strange" tag names (with ":", "_" or "-") in HTML lexer.
-rw-r--r-- | pygments/lexers/web.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py index 7d2c812a..eb14d4c6 100644 --- a/pygments/lexers/web.py +++ b/pygments/lexers/web.py @@ -722,8 +722,10 @@ class HtmlLexer(RegexLexer): ('<![^>]*>', Comment.Preproc), (r'<\s*script\s*', Name.Tag, ('script-content', 'tag')), (r'<\s*style\s*', Name.Tag, ('style-content', 'tag')), - (r'<\s*[a-zA-Z0-9:]+', Name.Tag, 'tag'), - (r'<\s*/\s*[a-zA-Z0-9:]+\s*>', Name.Tag), + # note: this allows tag names not used in HTML like <x:with-dash>, + # this is to support yet-unknown template engines and the like + (r'<\s*[\w:.-]+', Name.Tag, 'tag'), + (r'<\s*/\s*[\w:.-]+\s*>', Name.Tag), ], 'comment': [ ('[^-]+', Comment), |