lib/isodoc/function/inline.rb in isodoc-1.0.7 vs lib/isodoc/function/inline.rb in isodoc-1.0.8

- old
+ new

@@ -88,9 +88,27 @@ out.span **{ class: "stem" } do |span| span.parent.add_child ooml end end + def image_title_parse(out, caption) + unless caption.nil? + out.p **{ class: "FigureTitle", style: "text-align:center;" } do |p| + p.b { |b| b << caption.to_s } + end + end + end + + def image_parse(node, out, caption) + attrs = { src: node["src"], + height: node["height"] || "auto", + width: node["width"] || "auto", + title: node["title"], + alt: node["alt"] } + out.img **attr_code(attrs) + image_title_parse(out, caption) + end + def error_parse(node, out) text = node.to_xml.gsub(/</, "&lt;").gsub(/>/, "&gt;") out.para do |p| p.b(**{ role: "strong" }) { |e| e << text } end