lib/isodoc/presentation_function/xrefs.rb in isodoc-2.7.1 vs lib/isodoc/presentation_function/xrefs.rb in isodoc-2.7.2

- old
+ new

@@ -1,9 +1,14 @@ module IsoDoc class PresentationXMLConvert < ::IsoDoc::Convert - def prefix_container(container, linkend, node, _target) - l10n(@i18n.nested_xref.sub("%1", anchor_xref(node, container)) + def prefix_container(container, linkend, node, target) + prefix_container?(container, node) or return linkend + container_container = @xrefs.anchor(container, :container, false) + container_label = + prefix_container(container_container, anchor_xref(node, container), + node, target) + l10n(@i18n.nested_xref.sub("%1", container_label) .sub("%2", linkend)) end def anchor_value(id) @xrefs.anchor(id, :bare_xref) || @xrefs.anchor(id, :value) || @@ -29,11 +34,10 @@ end def anchor_linkend1(node) linkend = anchor_xref(node, node["target"]) container = @xrefs.anchor(node["target"], :container, false) - prefix_container?(container, node) and - linkend = prefix_container(container, linkend, node, node["target"]) + linkend = prefix_container(container, linkend, node, node["target"]) capitalise_xref(node, linkend, anchor_value(node["target"])) end def anchor_xref(node, target) x = @xrefs.anchor(target, :xref)