Skip to content

Add support for boolean attributes #5

@nmattia

Description

@nmattia

In the following HTML

<div disabled></div>

disabled is a boolean attribute.

2.5.2 Boolean attributes
A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.
The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.

reflex-jsx doesn't support boolean attributes. Reflex doesn't either out of the box, but boolean attributes could be replaced with attr="attr". This should only require changes to the parser.

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