mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 05:44:58 +00:00
Best way to have an allow/block list of HTML elements/attributes? #347
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Duncanma on GitHub (Feb 27, 2020).
Not really suggesting this as a base feature (although that would be great), more considering writing it as an extension myself and curious if someone on the project would have guidance on the best way to go about it (what part of the pipeline to engage with, etc). We are using markdig as the markdown parser behind https://docs.microsoft.com and would like to consider sanitizing our input more robustly. Thanks!
@mlaily commented on GitHub (Apr 27, 2020):
Not sure if useful, but I'm using https://github.com/mganss/HtmlSanitizer to do a second pass after
Markdown.ToHtml(markdown, _markdownPipeline).It's pretty flexible with its configuration.
@xoofx commented on GitHub (Oct 10, 2025):
As it is coming back again, closing this issue as won't fix. The rationale is that Markdig should not be a place for sanitizing a HTML document. Any extension could also output custom HTML that should be sanitized as well. For such scenario, there are more specialized tools like https://github.com/mganss/HtmlSanitizer as mentioned by @mlaily