Commits

Alain Poirier committed c24de16

Change all the `_` by `-` when an attribute begins by `data_`

Comments (0)

Files changed (1)

nagare/namespaces/xhtml_base.py

 @peak.rules.when(xml.add_attribute, (_HTMLTag, basestring, basestring))
 def add_attribute(next_method, self, name, value):
     if name.startswith('data_'):
-        name = 'data-' + name[5:]
+        name = name.replace('_', '-')
 
     next_method(self, name, value)