Merge pull request #2511 from denilsonsa/patch-1

This commit is contained in:
Parker Moore 2014-06-23 19:01:31 -04:00
commit e75dcc18f1
2 changed files with 5 additions and 5 deletions

View File

@ -83,7 +83,7 @@ eos
def add_code_tag(code)
# Add nested <code> tags to code blocks
code = code.sub(/<pre>\n*/,'<pre><code class="' + @lang.to_s.gsub("+", "-") + '">')
code = code.sub(/<pre>\n*/,'<pre><code class="language-' + @lang.to_s.gsub("+", "-") + '" data-lang="' + @lang.to_s + '">')
code = code.sub(/\n*<\/pre>/,"</code></pre>")
code.strip
end

View File

@ -91,11 +91,11 @@ CONTENT
end
should "render markdown with pygments" do
assert_match %{<pre><code class="text">test</code></pre>}, @result
assert_match %{<pre><code class="language-text" data-lang="text">test</code></pre>}, @result
end
should "render markdown with pygments with line numbers" do
assert_match %{<pre><code class="text"><span class="lineno">1</span> test</code></pre>}, @result
assert_match %{<pre><code class="language-text" data-lang="text"><span class="lineno">1</span> test</code></pre>}, @result
end
end
@ -105,7 +105,7 @@ CONTENT
end
should "not embed the file" do
assert_match %{<pre><code class="text">./jekyll.gemspec</code></pre>}, @result
assert_match %{<pre><code class="language-text" data-lang="text">./jekyll.gemspec</code></pre>}, @result
end
end
@ -115,7 +115,7 @@ CONTENT
end
should "render markdown with pygments line handling" do
assert_match %{<pre><code class="text">Æ</code></pre>}, @result
assert_match %{<pre><code class="language-text" data-lang="text">Æ</code></pre>}, @result
end
end