fix: define allowed styles in readme#2522
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
This changes the sanitization to set `allowedStyles` to only what shiki emits, since nothing else we run needs to emit inline styles. Also escapes image attributes.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR updates HTML rendering in README components. Changes include adding CSS containment to the Vue component, and hardening HTML sanitisation in the server utility by removing unsafe style attributes from tags, HTML-escaping image attributes, and restricting allowed styles to hex colour patterns. Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
91f4b7a to
2b4d6b8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🔗 Linked issue
N/A
🧭 Context
N/A
📚 Description
This changes the sanitization to set
allowedStylesto only what shikiemits, since nothing else we run needs to emit inline styles.
Also escapes image attributes.