]> git.lyx.org Git - features.git/blobdiff - src/mathed/MathExtern.cpp
Fix broken Apple speller interface
[features.git] / src / mathed / MathExtern.cpp
index a473259ba0b0707fc65f5db8d0f68cdf952011f9..daf171981f3fdb07bfee3b4a7f0006dfbae183b1 100644 (file)
@@ -1425,6 +1425,10 @@ void writeString(docstring const & s, TeXMathStream & os)
                os << (os.asciiOnly() ? escape(s) : s);
                return;
        }
+       else if (os.output() == TeXMathStream::wsSearchAdv) {
+               os << s;
+               return;
+       }
 
        if (os.lockedMode()) {
                bool space;
@@ -1590,15 +1594,18 @@ void mathmlize(MathData const & dat, MathMLStream & ms)
 {
        MathData ar = dat;
        extractStructure(ar, MATHML);
-       if (ar.empty())
-               ms << "<" << from_ascii(ms.namespacedTag("mrow")) << "/>";
-       else if (ar.size() == 1)
+       if (ar.empty()) {
+               if (!ms.inText())
+                       ms << CTag("mrow");
+       } else if (ar.size() == 1) {
                ms << ar.front();
-       else {
-               ms << MTag("mrow");
+       } else {
+               if (!ms.inText())
+                       ms << MTag("mrow");
                for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it)
                        (*it)->mathmlize(ms);
-               ms << ETag("mrow");
+               if (!ms.inText())
+                       ms << ETag("mrow");
        }
 }