Ensure `hard_wrap` renderer option is respected
This commit is contained in:
parent
e85aaadb63
commit
062ca6e65a
|
@ -18,10 +18,6 @@ class FlavoredMarkdown < Redcarpet::Render::HTML
|
|||
paragraph text
|
||||
end
|
||||
|
||||
def paragraph(text)
|
||||
"<p>#{text}</p>"
|
||||
end
|
||||
|
||||
def raw_html(raw_html)
|
||||
Rack::Utils.escape_html raw_html
|
||||
end
|
||||
|
|
|
@ -31,6 +31,10 @@ describe MarkdownHelper, type: :helper do
|
|||
it "should escape HTML tags" do
|
||||
expect(markdown("I'm <h1>a test</h1>")).to eq("<p>I'm <h1>a test</h1></p>")
|
||||
end
|
||||
|
||||
it "should turn line breaks into <br> tags" do
|
||||
expect(markdown("Some\ntext")).to eq("<p>Some<br>\ntext</p>")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#strip_markdown" do
|
||||
|
|
Loading…
Reference in New Issue