-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Whitelist anchor HTML tags? #99
Comments
Welcome @hrydgard! 👋 It is not currently a feature. So this project can have a plugin roughly equivalent to https://github.com/rehypejs/rehype-sanitize on the JavaScript side. |
Hi, yeah, I think something like that would help. I have a related issue though that even if I allow dangerous html, the following tag is not passed through:
That seems unexpected? |
Please post the code you use. I’m pretty sure that doesn’t happen normally. It happens when you turn gfm features on, including the stripping of iframes which gfm does |
let mut markdown_options = markdown::Options::gfm();
markdown_options.compile.allow_dangerous_html = true; yes, gfm, but forcing allow_dangerous_html to true. I guess that's not enough, though it sounds like it should be :) |
Right, I understand that you were not expecting that but I don’t see a better way. Other than adding docs to |
Oh, didn't realize gfm_tagfilter was even a thing. Yes, I think a comment in the docs of The name |
Added a note! But: “I didn’t realize gfm_tagfilter was a thing” sounds like you should also read what things happen when you |
Yeah, you're absolutely right about that :) |
In order to allow anchors in markdown, such as
<a name="my_anchor"></a>
, I have to turn onallow_dangerous_html
.Unfortunately markdown still lacks a syntax for this, although you can link to them:
[jump to my_anchor](#my_anchor)
I'd like to disallow all HTML except this very particular usage, since this is still a hole in the markdown language, AFAIK. Is that possible?
The text was updated successfully, but these errors were encountered: