From: Richard Heck Date: Mon, 23 Apr 2012 17:55:13 +0000 (-0400) Subject: Don't output extra body tags with included files. X-Git-Tag: 2.1.0beta1~1933^2~10 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e56ee0b2e656ccd3a466315c2867c82966629d51;p=features.git Don't output extra body tags with included files. --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 76ec7d81ab..2c4e9a4788 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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 << "\n" @@ -1852,11 +1852,14 @@ void Buffer::writeLyXHTMLSource(odocstream & os, } if (output_body) { - os << "\n"; + bool const output_body_tag = (output != IncludedFile); + if (output_body_tag) + os << "\n"; XHTMLStream xs(os); params().documentClass().counters().reset(); xhtmlParagraphs(text(), *this, xs, runparams); - os << "\n"; + if (output_body_tag) + os << "\n"; } if (output_preamble) diff --git a/src/Buffer.h b/src/Buffer.h index f740a37b92..8bf1417d8b 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -294,6 +294,7 @@ public: enum OutputWhat { FullSource, OnlyBody, + IncludedFile, OnlyPreamble, CurrentParagraph }; diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index c4a437bc19..904096069e 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -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 << "