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

Add preserveEscapedAttributes option to retain all attributes of escaped disallowed tags #668

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benelliott
Copy link

Fixes #540

Summary

Summarize the changes briefly, including which issue/ticket this resolves. If it closes an existing Github issue, include "Closes #[issue number]"

Add preserveEscapedAttributes option to allow attributes on escaped disallowed tags to be retained. Closes #540

What are the specific steps to test this change?

You can try the new behaviour by setting preserveEscapedAttributes to true when disallowedTagsMode is 'escape' or 'recursiveEscape'.

Added unit tests to PR.

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@BoDonkey BoDonkey self-requested a review July 8, 2024 19:26
Copy link
Contributor

@BoDonkey BoDonkey left a comment

Choose a reason for hiding this comment

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

At first blush, this looks good! Can you add another test to show that the preserveEscapedAttributes functions correctly with the other disallowedTagsMode, please? Thanks!

@benelliott benelliott force-pushed the feature/preserve-escaped-attributes-2 branch from 1fd052d to ce8405d Compare July 9, 2024 08:55
@benelliott
Copy link
Author

Thanks @BoDonkey, I've added another test case.

@benelliott benelliott requested a review from BoDonkey July 22, 2024 10:55
Copy link
Contributor

@BoDonkey BoDonkey left a comment

Choose a reason for hiding this comment

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

Nice last test. I would prefer that the docs include an example, but I'm not going to require it. Sorry that this got overlooked for a time.

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

Successfully merging this pull request may close these issues.

Allow escaping of more than just tags
2 participants