support for bbcode [code] blocks

This commit is contained in:
Sam
2017-06-29 16:04:10 -04:00
parent de50d8cd35
commit d941ed90d6
3 changed files with 67 additions and 26 deletions

View File

@ -784,6 +784,18 @@ HTML
expect(cooked).to eq(html)
end
it "supports inline code bbcode" do
cooked = PrettyText.cook "Testing [code]codified **stuff** and `more` stuff[/code]"
html = "<p>Testing <code>codified **stuff** and `more` stuff</code></p>"
expect(cooked).to eq(html)
end
it "supports block code bbcode" do
cooked = PrettyText.cook "[code]\ncodified\n\n\n **stuff** and `more` stuff\n[/code]"
html = "<pre><code class=\"lang-auto\">codified\n\n\n **stuff** and `more` stuff</code></pre>"
expect(cooked).to eq(html)
end
end
end