[Docs] Enable SCSS highlighting using the css highlighter

This commit is contained in:
Chris Eppstein 2010-05-06 19:07:51 -07:00
parent f728805be3
commit c58a9b6263

View File

@ -26,7 +26,7 @@ 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, :scss].each do |format|
doc.css("pre.source-code.#{format}, code.#{format}").each do |el| doc.css("pre.source-code.#{format}, code.#{format}").each do |el|
new_element = Nokogiri.make(highlight(el.inner_text, format)) new_element = Nokogiri.make(highlight(el.inner_text, format))
new_element.set_attribute("class", new_element.attribute("class").value+" "+el.attribute("class").value) new_element.set_attribute("class", new_element.attribute("class").value+" "+el.attribute("class").value)