Skip to content

Add prepend_mod to CommonMark

What does this MR do and why?

Add prepend_mod to Banzai::Filter::MarkdownEngines::CommonMark.

CommonMark is the default markdown engine of GitLab.

JH needs to adjust rendering options for special-case issues, so this class needs to be prepended.

Reference: CommonMarker Render options

Name Description
:DEFAULT The default rendering system.
:SOURCEPOS Include source position in rendered HTML.
:HARDBREAKS Treat \n as hardbreaks (by adding <br/>).
:UNSAFE Allow raw/custom HTML and unsafe links.
:NOBREAKS Translate \n in the source to a single whitespace.
:VALIDATE_UTF8 Replace illegal sequences with the replacement character U+FFFD.
:SMART Use smart punctuation (curly quotes, etc.).
:GITHUB_PRE_LANG Use GitHub-style <pre lang> for fenced code blocks.
:LIBERAL_HTML_TAG Support liberal parsing of inline HTML tags.
:FOOTNOTES Render footnotes.
:STRIKETHROUGH_DOUBLE_TILDE Parse strikethroughs by double tildes (compatibility with redcarpet)
:TABLE_PREFER_STYLE_ATTRIBUTES Use style insted of align for table cells.
:FULL_INFO_STRING Include full info strings of code blocks in separate attribute.

/cc JH EM @prajnamas

Merge request reports

Loading