Skip to content

Commit

Permalink
Actually, can strip another 2 lines off
Browse files Browse the repository at this point in the history
  • Loading branch information
Tariksin committed May 18, 2010
1 parent 2db226b commit 90bb99f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/syntaxcolorize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ def run(content, params={})
doc = Nokogiri::HTML(content)
doc.css('pre').each do |scan|
scan.css("code").each do |data|
code = codify(data.inner_text, :ruby)
data.inner_html = code
data.inner_html = codify(data.inner_text, :ruby)
end
scan.css("code[@class*=language-]").each do |data|
lang = /language-([a-z0-9\-_]+)/.match(data['class'])[1]
code = codify(data.inner_text, lang)
data.inner_html = code
data.inner_html = codify(data.inner_text, lang)
end
end
doc.to_s
Expand Down

0 comments on commit 90bb99f

Please sign in to comment.