Method: IsoDoc::WordFunction::Postprocess#word_image_caption
- Defined in:
- lib/isodoc/word_function/postprocess.rb
#word_image_caption(docxml) ⇒ Object
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/isodoc/word_function/postprocess.rb', line 117 def word_image_caption(docxml) docxml.xpath("//p[@class = 'FigureTitle' or @class = 'SourceTitle']") .each do |t| if t.previous_element&.name == "img" img = t.previous_element t.previous_element.swap("<p class='figure'>#{img.to_xml}</p>") end style_update(t.previous_element, "page-break-after:avoid;") end end |