lib/isodoc/presentation_function/block.rb in isodoc-2.4.5 vs lib/isodoc/presentation_function/block.rb in isodoc-2.5.0

- old
+ new

@@ -29,11 +29,19 @@ def formula(docxml) docxml.xpath(ns("//formula")).each { |f| formula1(f) } end def formula1(elem) + formula_where(elem.at(ns("./dl"))) lbl = @xrefs.anchor(elem["id"], :label, false) prefix_name(elem, "", lbl, "name") + end + + def formula_where(dlist) + dlist or return + dlist["class"] = "formula_dl" + where = dlist.xpath(ns("./dt")).size > 1 ? @i18n.where : @i18n.where_one + dlist.previous = "<p keep-with-next='true'>#{where}</p>" end def example(docxml) docxml.xpath(ns("//example")).each { |f| example1(f) } end