]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathFrac.cpp
MathML: fix validity for fractions with units.
[lyx.git] / src / mathed / InsetMathFrac.cpp
index e58a7870575edd0bf4a6c80ddc389394fbd00e9a..3ad0dfe188d86d4341600f638bc53450133119d9 100644 (file)
@@ -543,17 +543,20 @@ void InsetMathFrac::mathmlize(MathMLStream & ms) const
                break;
 
        case UNIT:
-               // FIXME This is not right, because we still output mi, etc,
-               // when we output the cell. So we need to prevent that somehow.
-               if (nargs() == 2)
-                       ms << cell(0)
-                          << MTag("mstyle mathvariant='normal'") 
-                          << cell(1) 
-                          << ETag("mstyle");
-               else
-                       ms << MTag("mstyle mathvariant='normal'")
-                          << cell(0)
-                          << ETag("mstyle");
+               if (nargs() == 2) {
+                       ms << MTag("mrow");
+                       ms << cell(0);
+                       SetMode textmode(ms, true);
+                       ms << MTagInline("mstyle mathvariant='normal'");
+                       ms << cell(1);
+                       ms << ETagInline("mstyle");
+                       ms << ETag("mrow");
+               } else {
+                       SetMode textmode(ms, true);
+                       ms << MTag("mstyle mathvariant='normal'");
+                       ms << cell(0);
+                       ms << ETag("mstyle");
+               }
        }
 }