Redcarpet不显示前

时间:2011-07-28 14:32:46

标签: ruby-on-rails ruby-on-rails-3

当我尝试

 ```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 

1 个答案:

答案 0 :(得分:0)

FWIW:代码块和前一个文本之间至少有一行间隙

链接回答:http://railscasts.com/episodes/272-markdown-with-redcarpet?view=comments#comment_153061