Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of <textarea> wrap attribute #925

Closed
ghost opened this issue Mar 24, 2024 · 3 comments
Closed

Removal of <textarea> wrap attribute #925

ghost opened this issue Mar 24, 2024 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 24, 2024

Background & Context

It looks like DOMPurify is removing the wrap attribute on elements like <textarea>.

Bug

Is this intentional? I'm guessing it might be a side-effect of something else, but if it's intentional, could you share some info on the risks created by this attribute or others like it?

Input

<textarea
    rows = '1'
    cols = '20'
    wrap = 'soft'>
</textarea>

Given output

<textarea
    rows = '1'
    cols = '20'>
</textarea>

Expected output

<textarea
    rows = '1'
    cols = '20'
    wrap = 'soft'>
</textarea>

Feature

If this attribute is being removed not because of a direct risk, but as a side-effect of something else, could that behavior be reversed without much trouble?

@cure53
Copy link
Owner

cure53 commented Mar 25, 2024

Hey there, thanks for raising this - as far as I can see, there is no security-related reason for removing the wrap attribute, we should safely be able to add it.

Wanna spin up a PR? :)

@ghost ghost mentioned this issue Mar 25, 2024
@ghost
Copy link
Author

ghost commented Mar 25, 2024

Thanks for the quick response! And also for the great library.

I'm not too familiar with its internal workings, but I did a quick review and I think (hope) the fix was just adding the wrap attribute to the html list in attrs.js? I opened a PR with that change, if that's hopefully all that was needed.

@cure53
Copy link
Owner

cure53 commented Mar 26, 2024

This looks great, thank you :)

@cure53 cure53 closed this as completed Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant