test/devcenter-parser_test.rb in devcenter-parser-2.1.1 vs test/devcenter-parser_test.rb in devcenter-parser-2.1.2
- old
+ new
@@ -42,63 +42,20 @@
SRC
assert_parsing_result src, src
end
describe 'github markdown' do
-
- it 'removes markdown links or nested tags inside HTML comments' do
- md = <<-MD
-<!-- c1 -->
-1<!-- c2 -->
-<!-- c3 -->2
-3<!-- c4 -->4
-
-One
-
-<!-- [c1](c1) -->
-5<!-- [c2](c2) -->
-<!-- [c3](c3) -->6
-7<!-- [c4](c4) -->8
-
-Two
-
-<!-- <a href="#">c1</a> -->
-9<!-- <a href="#">c2</a> -->
-<!-- <a href="#">c3</a> -->10
-11<!-- <a href="#">c4</a> -->12
-
-Three
-MD
-
- html = <<-HTML
-<!-- c1 -->
-
-<p>1<!-- c2 -->
-<!-- c3 -->2
-3<!-- c4 -->4</p>
-
-<p>One</p>
-
-<!-- c1c1 -->
-
-<p>5<!-- c2c2 -->
-<!-- c3c3 -->6
-7<!-- c4c4 -->8</p>
-
-<p>Two</p>
-
-<!-- a href="#"c1/a -->
-
-<p>9<!-- a href="#"c2/a -->
-<!-- a href="#"c3/a -->10
-11<!-- a href="#"c4/a -->12</p>
-
-<p>Three</p>
-HTML
-
- assert_parsing_result md, html
+ it 'leaves HTML comments' do
+ md = '<!-- c1 -->'
+ html ='<!-- c1 -->'
+ assert_parsing_result(md, html)
end
+ it 'removes tag brackets < and > from HTML comments so they do not appear accidentally in generated HTML' do
+ md = '<!-- <a href="#foo">foo</a> -->'
+ html = '<!-- a href="#foo"foo/a -->'
+ assert_parsing_result(md, html)
+ end
it 'generates apostrophes from single quotes in plain text' do
md = "That's it"
html = "<p>That’s it</p>"
assert_parsing_result(md, html)