116
117
118
119
120
121
122
123
124
125
126
127
|
# File 'lib/isodoc/presentation_function/math.rb', line 116
def mathml_linebreak(node)
node.at(".//*/@linebreak") or return
m = Plurimath::Math.parse(node.to_xml, :mathml)
.to_mathml(split_on_linebreak: true)
ret = Nokogiri::XML("<m>#{m}</m>").root
ret.elements.each_with_index do |e, i|
i.zero? or e.previous = "<br/>"
end
node.replace(" <math-with-linebreak>\#{ret.children}</math-with-linebreak><math-no-linebreak>\#{node.to_xml}</math-no-linebreak>\n OUTPUT\nend\n")
|