Skip to content

onclick attribute gets stripped when last #3926

@fsLeg

Description

@fsLeg

While editing one of my severely outdated pages I noticed one extremely annoying behavior: onclick attribute gets stripped if it's the last attribute of a tag.

Example of stripping (add this code to a page and save):

<a href="#" onclick="alert('Hey!');">Clicking on this link will do nothing.</a>

Example of not stripping:

<a onclick="alert('Hey!');" href="#">Clicking on this link will produce an alert.</a>

Considering that a lot of my links on certain pages are in form of buttons that rely on onclick attribute, quite a lot of information was lost due to me not knowing about this quirk.

I haven't tested this behavior outside of pages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: testing requiredSomeone needs to confirm this issue's existence and write a test to prevent the fix from regressing.type: bugA problem that should not be happening

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions