You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It turns out commonmarker by default removes HTML tags from markdown for safety. Since we already implement our own sanitization, this seems superfluous: indeed, other renders such as kramdown already leave HTML elements in by default.
So it may be deisrable to override the commonmarker defaults and activate its :UNSAFE option. However, this would require overriding yet another block of code from github-markup, like here, which would be a bit messy.
Alternatively, we could make use of the fact that github-markup allows passing in an options hash with commonmarker settings, e.g.: GitHub::Markup.render("test.md", "hello <bad> world", options: {commonmarker_opts: [:UNSAFE]})
However, since this option does not exist for kramdown yet, it would mean we would have to manage our defaults for commonmark and kramdown in two different ways: overriding the Proc for the latter, and passing an options hash in our call to GitHub::Markup.render for the former. I've therefore opened a PR at github-markup: github/markup#1543
If this is merged, it woud allow us to refactor the way we override options for the markdown rendering gems.
The text was updated successfully, but these errors were encountered:
It turns out
commonmarker
by default removes HTML tags from markdown for safety. Since we already implement our own sanitization, this seems superfluous: indeed, other renders such askramdown
already leave HTML elements in by default.So it may be deisrable to override the
commonmarker
defaults and activate its:UNSAFE
option. However, this would require overriding yet another block of code fromgithub-markup
, like here, which would be a bit messy.Alternatively, we could make use of the fact that
github-markup
allows passing in an options hash withcommonmarker
settings, e.g.:GitHub::Markup.render("test.md", "hello <bad> world", options: {commonmarker_opts: [:UNSAFE]})
However, since this option does not exist for
kramdown
yet, it would mean we would have to manage our defaults forcommonmark
andkramdown
in two different ways: overriding theProc
for the latter, and passing an options hash in our call toGitHub::Markup.render
for the former. I've therefore opened a PR atgithub-markup
: github/markup#1543If this is merged, it woud allow us to refactor the way we override options for the markdown rendering gems.
The text was updated successfully, but these errors were encountered: