Skip to content

HTML5 empty attributes are being scrubbed #242

@dometto

Description

@dometto

a6922ce seems to have had the effect of scrubbing valueless attributes even if they are in SafeList. For example, even after adding controls to the SafeList with:

Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES.add('controls')

The controls attribute will be removed from video tags like the following:

<video ... controls>...</video>
<video ... controls="">...</video>

But not from the following:

<video ... controls="true">...</video>

However, just having controls without a value seems to be valid HTML5.

Is this intended behaviour or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions