lib/mathml2asciimath/m2a.rb in mathml2asciimath-0.0.7 vs lib/mathml2asciimath/m2a.rb in mathml2asciimath-0.0.8
- old
+ new
@@ -162,19 +162,19 @@
def self.parse(node)
out = ""
if node.text?
return encodechars(HTMLEntities.new.decode(node.text))
else
- case node.name
+ case node.name.sub(/^[^:]*:/, "")
when "math"
node.elements.each { |n| out << parse(n) }
return out
when "mrow"
outarr = []
node.children.each { |n| outarr << parse(n) }
out = outarr.join("")
- if %w{mfrac msub munder munderover}.include? node.parent.name
+ if %w{mfrac msub munder munderover}.include? node.parent.name.sub(/^[^:]*:/, "")
out = "(#{out})"
end
return out
when "mfenced"
outarr = []
@@ -266,7 +266,6 @@
else
node.to_xml
end
end
end
-
end