Fixes HTML validation issues with code highlighting

This commit is contained in:
Frederic Hemberger 2011-09-18 13:55:35 +02:00
parent 9e5e3c5d2f
commit 347e855ddc
3 changed files with 7 additions and 7 deletions

View file

@ -27,7 +27,7 @@ module BacktickCodeBlock
end
if @lang.nil? || @lang == 'plain'
code = tableize_code(str.gsub('<','&lt;').gsub('>','&gt;'))
"<figure role=code>#{@caption}#{code}</figure>"
"<figure class='code'>#{@caption}#{code}</figure>"
else
if @lang.include? "-raw"
raw = "``` #{@options.sub('-raw', '')}\n"
@ -35,7 +35,7 @@ module BacktickCodeBlock
raw += "\n```\n"
else
code = highlight(str, @lang)
"<figure role=code>#{@caption}#{code}</figure>"
"<figure class='code'>#{@caption}#{code}</figure>"
end
end
end