当我尝试
时 ```ruby
puts "hello world"
```
我得到了
<code>ruby<br>
print "hello world" <br></code>
但没有得到
<pre lang="ruby">
rails code
options = [:hard_wrap, :filter_html, :autolink, :no_intraemphasis, :fenced_code, :gh_blockcode]
Redcarpet.new(text, *options).to_html
答案 0 :(得分:0)
FWIW:代码块和前一个文本之间至少有一行间隙
链接回答:http://railscasts.com/episodes/272-markdown-with-redcarpet?view=comments#comment_153061