#include <sstream>
+#include <iostream>
+
using namespace std;
using namespace lyx::support;
xs << XMLStream::ESCAPE_NONE << parXML;
auto p = pars.begin();
while (true) { // For each line of this ERT paragraph...
- os << *p;
+ os << *p;
++p;
if (p != pars.end())
os << "\n";
// auto lay = getLayout();
// }
- // Output the ERT as a comment with the appropriate escaping.
- xs << XMLStream::ESCAPE_NONE << "<!-- ";
- xs << XMLStream::ESCAPE_COMMENTS << os.str();
- xs << XMLStream::ESCAPE_NONE << " -->";
+ // Output the ERT as a comment with the appropriate escaping if the command is not recognised.
+ if (trim(os.str()) == from_ascii("\\textquotesingle")) {
+ xs << "'";
+ } else {
+ xs << XMLStream::ESCAPE_NONE << "<!-- ";
+ xs << XMLStream::ESCAPE_COMMENTS << os.str();
+ xs << XMLStream::ESCAPE_NONE << " -->";
+ }
}