diff --git a/mode/xml.py b/mode/xml.py index d4b7a48..2b351e5 100644 --- a/mode/xml.py +++ b/mode/xml.py @@ -20,9 +20,9 @@ class CommentGrammar(Grammar): rules = [PatternRule('data', '(?:[^-]|-(?!-)|--(?!>))+')] class TagGrammar(Grammar): rules = [ - PatternRule('attrname', '[a-zA-Z_][a-zA-Z0-9_]+(?==)'), + PatternRule('attrname', '[a-zA-Z_][-a-zA-Z0-9_]*(?==)'), PatternRule('namespace', '[a-zA-Z_]+(?=:)'), - PatternRule('name', '[a-zA-Z_][a-zA-Z0-9_]*'), + PatternRule('name', '[a-zA-Z_][-a-zA-Z0-9_]*'), PatternRule('delimiter', '[:/=]'), RegionRule('string', '"', StringGrammar1, '"'), RegionRule('string', "'", StringGrammar2, "'"),