Commits

Georg Brandl  committed d466b2e

Closes #846: support "strange" tag names (with ":", "_" or "-") in HTML lexer.

  • Participants
  • Parent commits 1cba4c4

Comments (0)

Files changed (1)

File pygments/lexers/web.py

             ('<![^>]*>', 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),