Skip to content

Support for disabling Sanitization#132

Open
eviltrout wants to merge 2 commits into
evilstreak:masterfrom
eviltrout:disable_sanitization
Open

Support for disabling Sanitization#132
eviltrout wants to merge 2 commits into
evilstreak:masterfrom
eviltrout:disable_sanitization

Conversation

@eviltrout

Copy link
Copy Markdown
Contributor

While sanitization is an important feature of a markdown parser, it is sometimes useful to disable it. For example, on Discourse we have our own sanitizer that is executed further down the pipeline after the markdown has been rendered, so we needn't execute the sanitization twice. Also, ours is a little more flexible and allows particular tags to be whitelisted.

This patch supports an option, sanitize: false, when rendering, to not perform sanitization. This option is not set by default so the existing behaviour stays the same unless expressly disabled.

Note this patch is based on the src attribute PR because it includes two rendering tests which belong to a newly introduced file in that PR.

@EnzoMartin

Copy link
Copy Markdown

Just ran into this issue, glad to see someone already submitted a fix for it, thanks

@peterbraden

Copy link
Copy Markdown

Is there some reason this hasn't been merged? I'd really like to use this.

@eviltrout

Copy link
Copy Markdown
Contributor Author

Bump here -- is there a good reason not to merge this? It is behind an option so it should not affect anyone who doesn't want it.

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.

3 participants