Skip to content

Empty Value Attribute Handling#75

Description

@NiklasPor

Hi all, great package, love it so far 馃殌

I'm currently struggling with one problem tho: The HTML attributes that have no specific value, actually automatically get transformed to have a value of their own key.

I think this transformation is kinda weird, especially since the current HTML standard is specifying that the value of an empty attribute is actually an empty string, not a string that matches the name of the attribute:

image
https://html.spec.whatwg.org/multipage/syntax.html#attributes-2

Additionally, it breaks the behavior of some JS / HTML frameworks, which is a pity. Here's a quick example without any plugins installed:

Input

<div a b c="c"></div>

Expected

<div a b c="c"></div>

Output

<div c="c" a="a" b="b" other="other"></div>

I'd also be open to contributing and fixing this if it would be appreciated.

Kind regards
Niklas

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions