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

feat: add support for html 5 tags #96

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Conversation

BlakeStearman
Copy link
Member

@BlakeStearman BlakeStearman commented Apr 29, 2024

Adds support for the following HTML 5 tags with the style attribute:

  • article
  • aside
  • details
  • footer
  • header
  • main
  • mark
  • nav
  • section
  • summary
  • time

Adds pre, code, and blockquote tags with style attribute.

Adds test case for sanitization of contents of pre tag.

Also adds the aria-label and aria-hidden attributes to the div tag.

Adds support for the following HTML 5 tags with the `style` attribute:
* `article`
* `aside`
* `details`
* `footer`
* `header`
* `main`
* `mark`
* `nav`
* `section`
* `summary`
* `time`

Adds test case for sanitization of contents of `pre` tag.

Also adds the `aria-label` and `aria-hidden` attributes to the `div` tag.
@BlakeStearman BlakeStearman added the enhancement New feature or request label Apr 29, 2024
@BlakeStearman BlakeStearman requested review from dasa and ssylvia April 29, 2024 17:59
@BlakeStearman BlakeStearman self-assigned this Apr 29, 2024
@@ -50,13 +50,13 @@ describe("Sanitizer", () => {

// Extending the defaults
const sanitizer2 = new Sanitizer(
{ allowCommentTag: false, whiteList: { blockquote: [] } },
{ allowCommentTag: false, whiteList: { blink: [] } },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test for extending the defaults was changed since we added blockquote to the main whitelist.

Copy link
Member

@dasa dasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but description should include blockquote, code, and pre as well.

@BlakeStearman
Copy link
Member Author

LGTM, but description should include blockquote, code, and pre as well.

Good catch. Description has been updated.

@BlakeStearman BlakeStearman merged commit de0aeda into master Apr 29, 2024
4 checks passed
@BlakeStearman BlakeStearman deleted the supported-tag-update branch April 29, 2024 18:12
@CodeBarker
Copy link

CodeBarker commented May 2, 2024

sorry Im late to the review, but I think this pr should have also included the css edits too?

@BlakeStearman
Copy link
Member Author

@CodeBarker I did not include those, no. I can take another pass at addressing those specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants