From be5fd5b4cae9c5c3119df29a277d3ca94e06a2fb Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 27 Mar 2010 21:18:29 -0700 Subject: [PATCH] fix a bug during syntax highlighting. --- doc-src/lib/data_sources/syntax_highter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc-src/lib/data_sources/syntax_highter.rb b/doc-src/lib/data_sources/syntax_highter.rb index 4d8767b4..7cb2b18b 100644 --- a/doc-src/lib/data_sources/syntax_highter.rb +++ b/doc-src/lib/data_sources/syntax_highter.rb @@ -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