markdown-js icon indicating copy to clipboard operation
markdown-js copied to clipboard

Support for disabling Sanitization

Open eviltrout opened this issue 12 years ago • 3 comments

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.

eviltrout avatar Oct 01 '13 19:10 eviltrout

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

EnzoMartin avatar Oct 10 '13 01:10 EnzoMartin

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

peterbraden avatar Jul 15 '14 15:07 peterbraden

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.

eviltrout avatar Jul 29 '14 14:07 eviltrout