Skip to content

refactor: use rehype-sanitize for html tags #4825

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

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

Conversation

alephpiece
Copy link
Contributor

原来使用正则检测允许的 tags,只要内容中有一个就会启用 rehype-raw。如果消息内容同时包含允许的和无效 tags,控制台会频繁报错。

用 rehype-sanitize 准确清理不允许的 tags,应该可以避免这种情况。

@alephpiece alephpiece marked this pull request as ready for review April 14, 2025 21:58
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