]> 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 18:14:01 +0000 (14:14 -0400)
src/Buffer.cpp
src/Buffer.h
src/insets/InsetInclude.cpp
status.20x

index 2ee94227132a68984b9a252acdd0c21fee510f57..e863ce3bcf679a86a638bf555eb27fcd9ad29e63 100644 (file)
@@ -1735,7 +1735,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"
@@ -1785,11 +1785,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 4249045600a735c69e6b5483938017880e70bddf..66b9b284869e2e5d51d91d6010675fca92e7d4ae 100644 (file)
@@ -278,6 +278,7 @@ public:
        enum OutputWhat {
                FullSource,
                OnlyBody,
+               IncludedFile,
                OnlyPreamble,
                CurrentParagraph
        };
index 559baff07a8f2ab89018aa9d3f2e9ccdd4cd24c6..568449790c3893e089dbc360a0fd7d27b8327c40 100644 (file)
@@ -785,7 +785,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: " 
index 8a5320234356c03317e65cd9d4147796e9a21da5..c6695751f8c0640eb71c882c4c3e50ea134dd5c3 100644 (file)
@@ -99,6 +99,9 @@ What's new
 - When configuring LyX, check for all LaTeX-packages LyX uses to display
   symbols (bug 8102).
 
+- Don't output extra body tags with included files when generating
+  XHTML.
+
 
 * USER INTERFACE