Skip to content

with GFM enabled, double-space for newline does not work #152

Closed
@mathematicalcoffee

Description

@mathematicalcoffee

In Markdown a double-space at the end of the line is supposed to create a break, like this:

require 'kramdown'
 Kramdown::Document.new("One  \nTwo").to_html
# => "<p>One<br />\nTwo</p>\n"

With GFM enabled and hard_wrap turned off, the same should happen, but it doesn't:

Kramdown::Document.new("One  \nTwo").to_html
# => "<p>One  \nTwo</p>\n"

I expect the double-space followed by end of line to be converted to a newline in GFM (when hard_wrap is turned off), because this is what happens in standard markdown, and the hard_wrap option is meant to turn embedded newlines in paragraphs into <br/>, so with the option off it should revert to normal markdown behaviour.

(with hard_wrap turned on one gets "

One
\nTwo

\n" because the newline after the two spaces is turned into a br, but I expect this anyway).

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions