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 4e1bc622ca
commit ddee4f872b
4 changed files with 11 additions and 4 deletions

View 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)

View File

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

View 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: "

View 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