fix a bug during syntax highlighting.

This commit is contained in:
Chris Eppstein 2010-03-27 21:18:29 -07:00
parent 03568253bd
commit be5fd5b4ca

View File

@ -24,8 +24,8 @@ class SyntaxHighlighterFilter < Nanoc3::Filter
def run(content, params={})
doc = Nokogiri::HTML.fragment(content)
[:html, :css, :sass].each do |format|
doc.css("code.#{format}").each do |el|
el.parent.replace Nokogiri.make(highlight(el.inner_text, format))
doc.css("pre.source-code.#{format}, code.#{format}").each do |el|
el.replace Nokogiri.make(highlight(el.inner_text, format))
end
end
doc.to_s