Skip to content

Commit 056ec27

Browse files
committed
change treatment of n-ary MathML: metanorma/metanorma-ieee#713
1 parent 895db14 commit 056ec27

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/html2doc/math.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ def encode_math(elem)
6161
def mathml_insert_rows(math, docnamespaces)
6262
math.xpath(%w(msup msub msubsup munder mover munderover)
6363
.map { |m| ".//xmlns:#{m}" }.join(" | "), docnamespaces).each do |x|
64-
next unless x.next_element && x.next_element != "mrow"
65-
66-
x.next_element.wrap("<mrow/>")
64+
#next unless x.next_element && x.next_element != "mrow"
65+
#x.next_element.wrap("<mrow/>")
66+
x.elements.size == 2 or next
67+
x.elements.each do |y|
68+
%w(mrow mstyle).include?(y.name) or next
69+
y.wrap("<mrow/>")
70+
end
6771
end
6872
math
6973
end

0 commit comments

Comments
 (0)