fix a bug during syntax highlighting.
This commit is contained in:
parent
03568253bd
commit
be5fd5b4ca
@ -24,8 +24,8 @@ class SyntaxHighlighterFilter < Nanoc3::Filter
|
|||||||
def run(content, params={})
|
def run(content, params={})
|
||||||
doc = Nokogiri::HTML.fragment(content)
|
doc = Nokogiri::HTML.fragment(content)
|
||||||
[:html, :css, :sass].each do |format|
|
[:html, :css, :sass].each do |format|
|
||||||
doc.css("code.#{format}").each do |el|
|
doc.css("pre.source-code.#{format}, code.#{format}").each do |el|
|
||||||
el.parent.replace Nokogiri.make(highlight(el.inner_text, format))
|
el.replace Nokogiri.make(highlight(el.inner_text, format))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
doc.to_s
|
doc.to_s
|
||||||
|
Loading…
Reference in New Issue
Block a user