lib/isodoc/function/inline.rb in isodoc-0.9.0 vs lib/isodoc/function/inline.rb in isodoc-0.9.1

- old
+ new

@@ -20,20 +20,23 @@ def callout_parse(node, out) out << " &lt;#{node.text}&gt;" end + def prefix_container(container, linkend, _target) + l10n(get_anchors[container][:xref] + ", " + linkend) + end + def anchor_linkend(node, linkend) if node["citeas"].nil? && node["bibitemid"] && get_anchors.has_key?(node["bibitemid"]) - #return get_anchors[node["bibitemid"]][:xref] return get_anchors.dig(node["bibitemid"] ,:xref) elsif node["target"] && get_anchors.has_key?(node["target"]) linkend = get_anchors[node["target"]][:xref] container = get_anchors[node["target"]][:container] (container && get_note_container_id(node) != container) && - linkend = l10n(get_anchors[container][:xref] + ", " + linkend) + linkend = prefix_container(container, linkend, node["target"]) end linkend end def get_linkend(node) @@ -74,13 +77,13 @@ end end def stem_parse(node, out) ooml = if node["type"] == "AsciiMath" - "#{@openmathdelim}#{node.text}#{@closemathdelim}" + "#{@openmathdelim}#{HTMLEntities.new.encode(node.text)}#{@closemathdelim}" elsif node["type"] == "MathML" then node.first_element_child.to_s else - node.text + HTMLEntities.new.encode(node.text) end out.span **{ class: "stem" } do |span| span.parent.add_child ooml end end