vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Indented code messed up #135

Closed bootstraponline closed 11 years ago

bootstraponline commented 11 years ago

Extra spacing is added.

https://github.com/github/gollum/issues/560#issuecomment-9812284

require 'rubygems'
require 'redcarpet'
require 'redcarpet/render_man'

renderer = Redcarpet::Render::HTML.new(render_options={})

markdown = Redcarpet::Markdown.new(renderer, extensions={})

puts markdown.render %(    hi
    2)

Expected

<pre><code>hi
2
</code></pre>

Instead in gollum, which uses sundown via redcarpet, it's this.

<pre>  <code>hi
2
</code>
</pre>

I'm not sure where the issue is. Somehow two spaces are being added yet redcarpet in the above example returns the expected result.

bootstraponline commented 11 years ago

The issue was nokogiri's to_xhtml method.