]> git.lyx.org Git - features.git/commitdiff
Don't output extra body tags with included files.
authorRichard Heck <rgheck@lyx.org>
Mon, 23 Apr 2012 17:55:13 +0000 (13:55 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 23 Apr 2012 17:55:13 +0000 (13:55 -0400)
src/Buffer.cpp
src/Buffer.h
src/insets/InsetInclude.cpp

index 76ec7d81ab217aad1d23365916a69b608a0e3990..2c4e9a4788392b8e77413adddce0c76820768349 100644 (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)
index f740a37b9236c28a0db82e64bd76c5636928e78f..8bf1417d8b811abf801073f6d22d4c27f1b18b0b 100644 (file)
@@ -294,6 +294,7 @@ public:
        enum OutputWhat {
                FullSource,
                OnlyBody,
+               IncludedFile,
                OnlyPreamble,
                CurrentParagraph
        };
index c4a437bc195a5a6c6e681d7d493a16597bb21722..904096069e9804efe7de848255940ea51de15b13 100644 (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: "