warn about extra sanitization on RSS page#6206
Merged
sarah11918 merged 3 commits intowithastro:mainfrom Jan 9, 2024
mayank99:patch-2
Merged
warn about extra sanitization on RSS page#6206sarah11918 merged 3 commits intowithastro:mainfrom mayank99:patch-2
sarah11918 merged 3 commits intowithastro:mainfrom
mayank99:patch-2
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
mayank99
commented
Jan 9, 2024
|
|
||
| :::tip | ||
| A package like [`sanitize-html`](https://www.npmjs.com/package/sanitize-html) will make sure that your content is properly sanitized, escaped, and encoded. | ||
| A package like [`sanitize-html`](https://www.npmjs.com/package/sanitize-html) will make sure that your content is properly sanitized, escaped, and encoded. In the process, such a package might also remove some harmless elements and attributes, so make sure to verify the output and configure the package according to your needs. |
Contributor
Author
There was a problem hiding this comment.
Could be useful to link to something like https://github.com/apostrophecms/sanitize-html#common-use-cases, but I didn't want to make this tip too verbose
Member
There was a problem hiding this comment.
@mayank99 Although not a direct link to the anchor, the npm readme does include the "common use cases" so someone can certainly get there just by reading further down the page.
Let's merge the tip as is for now, which I think sounds great!
sarah11918
approved these changes
Jan 9, 2024
Member
sarah11918
left a comment
There was a problem hiding this comment.
Thank you so much for picking this up, @mayank99 ! I think it's a great addition!
ematipico
pushed a commit
that referenced
this pull request
Jan 26, 2024
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description (required)
Discussed beforehand with Sarah, this PR expands the tip about
sanitize-htmlto warn about potentially too much sanitization.When I first added RSS to my blog, I simply followed the tutorial and it took me quite a bit of time to understand that many parts of the post content were broken because
sanitize-htmlwas stripping out elements and attributes beyond just<script>and<style>.Related issues & labels (optional)