Try the following:
CodeRay Style Sheet
And then:
doc = Nokogiri::HTML(html)
doc.search("//pre//code[@class]").each do |pre|
tokens = CodeRay.scan(pre.text, pre[:class])
pre.replace tokens.div(:css => :class)
end
The trick is to make your markers with a CSS class.
source
share