Closed konklone closed 10 years ago
Newlines are being generated at the beginning and end of the <code> blocks generated by fenced_code_blocks (whether tildes or backticks). This does not occur with <code> blocks generated by indentations.
<code>
fenced_code_blocks
With fenced code blocks:
fenced = "```ruby\nputs \"Hello world\"\n```\n" Maruku.new(fenced, fenced_code_blocks: true).to_html
yields:
"\n<pre class=\"ruby\"><code class=\"ruby\">\nputs "Hello world"\n</code></pre>\n"
This causes the display to look like this:
puts "Hello world"
Without fenced code blocks (whether or not the fenced_code_blocks option is passed):
normal = " puts \"hello world\"\n" Maruku.new(normal).to_html
"\n<pre><code>puts "hello world"</code></pre>\n"
Which looks fine:
puts "hello world"
And filed a PR over at #112, whose tests pass, that fixes this.
Newlines are being generated at the beginning and end of the
<code>
blocks generated byfenced_code_blocks
(whether tildes or backticks). This does not occur with<code>
blocks generated by indentations.With fenced code blocks:
yields:
This causes the display to look like this:
Without fenced code blocks (whether or not the
fenced_code_blocks
option is passed):yields:
Which looks fine: