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

Replace Bleach with NH3 #2505

Merged
merged 2 commits into from
Mar 31, 2025
Merged

Replace Bleach with NH3 #2505

merged 2 commits into from
Mar 31, 2025

Conversation

symroe
Copy link
Member

@symroe symroe commented Mar 28, 2025

No description provided.

@symroe symroe requested a review from awdem March 28, 2025 17:23
)
# before linkifying any URLs:.
context["justification_for_use"] = urlize(
nh3.clean(self.queued_image.justification_for_use)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does nh3.clean() default to stripping the html tags? It looks like we had to pass strip=True to bleach.clean().

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah good catch. I assumed not passing an allowlist would strip all tags, but I've pushed a commit to allow a tags and nothing else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that looks like it does the trick.

@symroe symroe requested a review from awdem March 31, 2025 09:31
@symroe symroe merged commit 7aea6a3 into master Mar 31, 2025
6 checks passed
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.

2 participants