]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathString.cpp
Substack support for XHTML.
[lyx.git] / src / mathed / InsetMathString.cpp
index ac951a1838203e0137a2cdc32c4ea3a37bda24b0..98b641a72655d922a37acce871b696727d5e8aab 100644 (file)
@@ -23,6 +23,8 @@
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
+using lyx::support::escape;
+
 
 namespace lyx {
 
@@ -99,7 +101,7 @@ void InsetMathString::mathmlize(MathStream & /*os*/) const
 void InsetMathString::write(WriteStream & os) const
 {
        if (!os.latex() || os.lockedMode()) {
-               os << str_;
+               os << (os.asciiOnly() ? escape(str_) : str_);
                return;
        }
 
@@ -164,7 +166,7 @@ void InsetMathString::write(WriteStream & os) const
                        }
                        case WriteStream::wsPreview: {
                                // indicate the encoding error by a boxed '?'
-                               os << "{\\fboxsep=1pt\\fbox{?}}";;
+                               os << "{\\fboxsep=1pt\\fbox{?}}";
                                LYXERR0("Uncodable character" << " '"
                                        << docstring(1, e.failed_char)
                                        << "'");