Don't output extra body tags with included files.

This commit is contained in:
Richard Heck 2012-04-23 13:55:13 -04:00
parent 40cc43f150
commit e56ee0b2e6
3 changed files with 8 additions and 4 deletions

View File

@ -1769,7 +1769,7 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
bool const output_preamble =
output == FullSource || output == OnlyPreamble;
bool const output_body =
output == FullSource || output == OnlyBody;
output == FullSource || output == OnlyBody || output == IncludedFile;
if (output_preamble) {
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
@ -1852,11 +1852,14 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
}
if (output_body) {
os << "<body>\n";
bool const output_body_tag = (output != IncludedFile);
if (output_body_tag)
os << "<body>\n";
XHTMLStream xs(os);
params().documentClass().counters().reset();
xhtmlParagraphs(text(), *this, xs, runparams);
os << "</body>\n";
if (output_body_tag)
os << "</body>\n";
}
if (output_preamble)

View File

@ -294,6 +294,7 @@ public:
enum OutputWhat {
FullSource,
OnlyBody,
IncludedFile,
OnlyPreamble,
CurrentParagraph
};

View File

@ -793,7 +793,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
if (all_pars) {
op.par_begin = 0;
op.par_end = 0;
ibuf->writeLyXHTMLSource(xs.os(), op, Buffer::OnlyBody);
ibuf->writeLyXHTMLSource(xs.os(), op, Buffer::IncludedFile);
} else
xs << XHTMLStream::ESCAPE_NONE
<< "<!-- Included file: "