Skip to content

Underscore as an attribute is not rendered - used with htmx/hyperscript #193

@pablo8itall

Description

@pablo8itall

When trying to generate html that uses hyperscript in my htmx webapp Dominate does not allow me to use _ as an attribute for a tag.

>>>tag = div(_='on click do something')
>>>tag.render()  
'<div ="on click do something"></div>'

I assume its something to do with Python as typically we'd ignore named variables when they are underscores.

>>> def test(_):
...     print(_)
... 
>>> test(1)
1
>>> 

Although this just seems to be a convention and not a hard coded language feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions