test/devcenter-parser_test.rb in devcenter-parser-2.2.2rc2 vs test/devcenter-parser_test.rb in devcenter-parser-2.2.2rc3
- old
+ new
@@ -99,18 +99,16 @@
Another paragraph
MARKDOWN
html = <<-HTML
<p>Paragraph</p>
+<pre class="language-term"><code class="language-term">$ command
-<pre><code class="language-term">$ command
-
indented
< tag1
> tag2
</code></pre>
-
<p>Another paragraph</p>
HTML
assert_parsing_result md, html
end
@@ -308,9 +306,33 @@
end
it "does emdashes" do
md = "foo -- bar"
html = '<p>foo – bar</p>'
+ assert_parsing_result md, html
+ end
+
+ it "converts code block classes to language-<language>" do
+ md = <<-MARKDOWN
+```lang-ruby
+# a comment
+```
+
+```language-ruby
+# a comment
+```
+
+```ruby
+# a comment
+```
+MARKDOWN
+
+ html = <<-HTML
+<pre class="language-ruby"><code class="language-ruby"># a comment
+</code></pre><pre class="language-ruby"><code class="language-ruby"># a comment
+</code></pre><pre class="language-ruby"><code class="language-ruby"># a comment
+</code></pre>
+HTML
assert_parsing_result md, html
end
it 'converts relative links with missing initial slashes to article links' do
['foo', 'foo/bar', 'foo#bar', '123'].each do |href|