开发者

Redcarpet don't show the pre

开发者 https://www.devze.com 2023-03-23 19:04 出处:网络
when I try ```ruby puts \"hell开发者_C百科o world\" ``` I get <code>ruby<br> print \"hello world\" <br></code>

when I try

 ```ruby
 puts "hell开发者_C百科o world"
 ```

I get

<code>ruby<br> 
 print "hello world" <br></code>

but not get <pre lang="ruby">

the rails code

options = [:hard_wrap, :filter_html, :autolink, :no_intraemphasis, :fenced_code, :gh_blockcode] 
Redcarpet.new(text, *options).to_html 


FWIW: Have at least a one line gap between code block and preceding text

Link to answer: http://railscasts.com/episodes/272-markdown-with-redcarpet?view=comments#comment_153061

0

精彩评论

暂无评论...
验证码 换一张
取 消