st0012 · GitHub

@st0012

Enable the existing break_on_newline extension in DEFAULT_EXTENSIONS so
the Markdown parser converts soft line breaks to HardBreak objects. This
produces visible <br> line breaks in HTML output, matching GFM rendering.
The conversion happens in the Markdown parser's paragraph() method,
which is the proper place for Markdown-specific behavior. The generic
accept_paragraph in ToHtml is unchanged and has no Markdown-specific
logic.
Also remove the CJK-aware newline-to-space gsub from accept_paragraph
that is no longer needed. The RDoc markup parser already handles newline
joining at parse time in build_paragraph.

Read the original on github.com ↗