diff --git a/lib/asciidoctor/standoc/cleanup.rb b/lib/asciidoctor/standoc/cleanup.rb
index fd8827bd..539775b8 100644
--- a/lib/asciidoctor/standoc/cleanup.rb
+++ b/lib/asciidoctor/standoc/cleanup.rb
@@ -176,7 +176,7 @@ def mathml_mi_italics
# presuppose multichar mi upright, singlechar mi MathML default italic
def mathml_italicise(x)
- x.xpath(".//m:mi", "m" => MATHML_NS).each do |i|
+ x.xpath(".//m:mi[not(ancestor::*[@mathvariant])]", "m" => MATHML_NS).each do |i|
char = HTMLEntities.new.decode(i.text)
i["mathvariant"] = "normal" if mi_italicise?(char)
end
diff --git a/spec/asciidoctor-standoc/cleanup_spec.rb b/spec/asciidoctor-standoc/cleanup_spec.rb
index 53af477a..eb0b8095 100644
--- a/spec/asciidoctor-standoc/cleanup_spec.rb
+++ b/spec/asciidoctor-standoc/cleanup_spec.rb
@@ -1927,6 +1927,11 @@
α
+
AB
+
+
+ Α
+
+
++++
INPUT
@@ -1946,6 +1951,11 @@
α
+
AB
+
+
+ Α
+
+
@@ -1968,6 +1978,11 @@
α
+
AB
+
+
+ Α
+
+
@@ -1990,6 +2005,11 @@
α
+
AB
+
+
+ Α
+
+
@@ -2012,6 +2032,11 @@
α
+
AB
+
+
+ Α
+
+
@@ -2034,6 +2059,11 @@
α
+
AB
+
+
+ Α
+
+