2019-04-29 20:27:42 -04:00
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2014-06-05 20:34:21 -04:00
|
|
|
|
describe Import::Normalize do
|
|
|
|
|
describe "#normalize_code_blocks" do
|
|
|
|
|
it "normalizes 2 code blocks correctly" do
|
|
|
|
|
markdown = <<MD
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
<code>
|
|
|
|
|
I am a te "
|
|
|
|
|
</code></pre>
|
|
|
|
|
test
|
|
|
|
|
<pre><code>this is a ""</code></pre>
|
|
|
|
|
MD
|
|
|
|
|
expected = " \n \n```\n I am a te \"\n \n```\n\n test \n \n```\nthis is a \"\"\n```\n\n"
|
2015-01-09 11:34:37 -05:00
|
|
|
|
expect(Import::Normalize.normalize_code_blocks(markdown)).to eq(expected)
|
2014-06-05 20:34:21 -04:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|