Method: IsoDoc::HtmlFunction::Html#sourcecode_cleanup
- Defined in:
- lib/isodoc/html_function/postprocess.rb
#sourcecode_cleanup(html) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/isodoc/html_function/postprocess.rb', line 51 def sourcecode_cleanup(html) ann = ".//div[@class = 'annotation']" html.xpath("//pre[#{ann}] | //div[@class = 'sourcecode'][#{ann}]") .each do |p| ins = p.after("<pre class='sourcecode'/>").next_element p.xpath(ann).each do |d| ins << d.remove.children end end html end |