[kramdown-users] possible bug: kramdown wrapping <br> in <p>

Thomas Leitner t_leitner at gmx.at
Tue Aug 10 05:31:07 EDT 2010


On 2010-08-09 18:52 -0700 Matt Neuburg wrote:
> require 'kramdown'
> s = <<END
> <div>
> </div>
> <br />
> <div>
> </div>
> END
> puts Kramdown::Document.new(s).to_html
> 
> The result is:
> 
> <div>
> </div>
> <p><br /></p>
> <div>
> </div>
> 
> This feels like a possible bug. m.

It isn't. The `<div></div>` parts before and after the `<br />` are
parsed with the block HTML parser, the `<br />` is no block HTML
element (like `<a>`), and therefore this line is parsed with the
paragraph parser.

-- Thomas


More information about the kramdown-users mailing list