Fix: #3738; Move code wrapper from div to figure.

This commit is contained in:
Jordon Bedwell 2015-06-10 15:20:44 -05:00
parent 80f63949cd
commit 137efdc9f4
3 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ module Jekyll
include CommonMethods include CommonMethods
def code_wrap(code) def code_wrap(code)
"<div class=\"highlight\"><pre>#{CGI::escapeHTML(code)}</pre></div>" "<figure class=\"highlight\"><pre>#{CGI::escapeHTML(code)}</pre></figure>"
end end
def block_code(code, lang) def block_code(code, lang)

View File

@ -113,7 +113,7 @@ eos
"class=\"language-#{@lang.to_s.gsub('+', '-')}\"", "class=\"language-#{@lang.to_s.gsub('+', '-')}\"",
"data-lang=\"#{@lang.to_s}\"" "data-lang=\"#{@lang.to_s}\""
].join(" ") ].join(" ")
"<div class=\"highlight\"><pre><code #{code_attributes}>#{code.chomp}</code></pre></div>" "<figure class=\"highlight\"><pre><code #{code_attributes}>#{code.chomp}</code></pre></figure>"
end end
end end

View File

@ -75,7 +75,7 @@ puts "Hello world"
end end
should "render fenced code blocks without syntax highlighting" do should "render fenced code blocks without syntax highlighting" do
assert_equal "<div class=\"highlight\"><pre><code class=\"language-ruby\" data-lang=\"ruby\">puts &quot;Hello world&quot;\n</code></pre></div>", @markdown.convert( assert_equal "<figure class=\"highlight\"><pre><code class=\"language-ruby\" data-lang=\"ruby\">puts &quot;Hello world&quot;\n</code></pre></figure>", @markdown.convert(
<<-EOS <<-EOS
```ruby ```ruby
puts "Hello world" puts "Hello world"