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
I'm having a hard time trying to figure out a way to use the render options with a custom renderer.
I inherited from CommonMarker::HtmlRenderer and customized some methods but now I can't find a way to do something like CustomRenderer.new.render_with_opts(doc, [:safe, :hardbreaks]).
Is it even possible? If it is could you help me with that?
Thanks!
The text was updated successfully, but these errors were encountered:
As you might have noticed, libcmark has two different types of options: parse options and render options. First a document is parsed to figure out the general structure, and then it's rendered into HTML. Since you're using a custom renderer, you have to be the one to define what to do when content is parsed.
The html_renderer class present in the gem gives the most barebones implementation possible. If I'm not mistaken, it actually defaults to doing safe already for you:
I'm having a hard time trying to figure out a way to use the render options with a custom renderer.
I inherited from
CommonMarker::HtmlRenderer
and customized some methods but now I can't find a way to do something likeCustomRenderer.new.render_with_opts(doc, [:safe, :hardbreaks])
.Is it even possible? If it is could you help me with that?
Thanks!
The text was updated successfully, but these errors were encountered: