Ensure hard_wrap renderer option is respected

This commit is contained in:
Karina Kwiatek 2023-02-15 23:51:59 +01:00
parent e85aaadb63
commit 062ca6e65a
2 changed files with 4 additions and 4 deletions

View file

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

View file

@ -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 &lt;h1&gt;a test&lt;/h1&gt;</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