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

Tags <ins> and <del> are not preserved when added to allowedTags #449

Closed
corinagum opened this issue Dec 22, 2020 · 3 comments
Closed

Tags <ins> and <del> are not preserved when added to allowedTags #449

corinagum opened this issue Dec 22, 2020 · 3 comments

Comments

@corinagum
Copy link

To Reproduce

const options = {
  allowedAttributes: {
    a: ['aria-label', 'href', 'name', 'rel', 'target', 'title'],
    img: ['alt', 'src']
  },
  allowedSchemes: ['data', 'http', 'https', 'ftp', 'mailto', 'sip', 'tel'],
  allowedTags: ['del', 'ins', 'etc...']
};
console.log(customMarkdownIt.render(sanitizeHTML('<ins>insert</ins> <del>delete</del>', options);
  1. Run above code
  2. Note result is <p>insert delete</p>

Expected behavior

<p><ins>insert</ins> <del>delete</del></p>

Describe the bug

Tags <ins> and <del> are filtered even when those tags are allowed to allowedTags.

Details

Version of Node.js:
12.8.3

Server Operating System:
Windows

Additional context:
N/A

Screenshots
N/A

@corinagum corinagum added the bug Something isn't working label Dec 22, 2020
@abea
Copy link
Contributor

abea commented Dec 22, 2020

customMarkdownIt is unrelated to this package. Please test again without that. I added those tags to the "should accept a custom list of allowed tags" test in the test suite and it worked fine.

Please specify what version of sanitize-html you're using.

@abea abea removed the bug Something isn't working label Dec 22, 2020
@abea abea closed this as completed Dec 23, 2020
@abea
Copy link
Contributor

abea commented Dec 23, 2020

I see you fixed your project issue. Closing this.

@corinagum
Copy link
Author

Hey sorry for the late reply, and for the confusion. Thought I did my due diligence and I was wrong. Thanks for taking a look.

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

2 participants