#include "LyXRC.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "output_plaintext.h"
#include "output_xhtml.h"
#include "OutputParams.h"
#include "TextClass.h"
}
-int InsetInclude::plaintext(odocstream & os, OutputParams const &) const
+int InsetInclude::plaintext(odocstream & os, OutputParams const & op) const
{
if (isVerbatim(params()) || isListings(params())) {
os << '[' << screenLabel() << '\n';
os << includedFileName(buffer(), params()).fileContents("UTF-8");
os << "\n]";
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
- } else {
+ }
+
+ Buffer const * const ibuf = loadIfNeeded();
+ if (!ibuf) {
docstring const str = '[' + screenLabel() + ']';
os << str;
return str.size();
}
+ writePlaintextFile(*ibuf, os, op);
+ return 0;
}