2
即使内容中有空格和换行符,我也无法获得换行符<br>。有没有什么办法可以在redcarpet中启用。无法使用redcarpet获得换行符
http://daringfireball.net/projects/markdown/syntax#p
“当你要插入使用降价一
休息标签,你行尾有两个或多个空格,然后键入的回报。”
为什么红地毯没有检测到空的空间线?
Loading development environment (Rails 3.2.3)
irb(main):001:0> rendere = Redcarpet::Render::HTML.new(:hard_wrap => true)
=> #<Redcarpet::Render::HTML:0xa2cc414>
irb(main):002:0> markdown = Redcarpet::Markdown.new(rendere, :autolink => true, :space_after_headers => true)
=> #<Redcarpet::Markdown:0x98ab0c0>
irb(main):003:0> markdown.render("hi how are you doing\n \nFirst line in the next paragraph\n \nFirst line in the third paragraph\n")
=> "<p>hi how are you doing</p>\n\n<p>First line in the next paragraph</p>\n\n<p>First line in the third paragraph</p>\n"
irb(main):004:0> markdown.render("hi how are you doing\r\n \r\nFirst line in the next paragraph\r\n \r\nFirst line in the third paragraph\r\n")
=> "<p>hi how are you doing</p>\n\n<p>First line in the next paragraph</p>\n\n<p>First line in the third paragraph</p>\n"
irb(main):005:0>