X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_xhtml.cpp;h=f1bcfb879b3cfba5b579fdde04d05b65bc9c41a8;hb=869247b6;hp=f8cd53e47867cfba71920ac9af059632b34af482;hpb=5f0720e9475daa2ce865fc641a4e97d94b4b36a1;p=features.git diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index f8cd53e478..f1bcfb879b 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Richard Heck + * \author Richard Kimberly Heck * * This code is based upon output_docbook.cpp * @@ -15,12 +15,10 @@ #include "output_xhtml.h" #include "Buffer.h" -#include "buffer_funcs.h" #include "BufferParams.h" #include "Counters.h" #include "Font.h" #include "Layout.h" -#include "OutputParams.h" #include "Paragraph.h" #include "ParagraphList.h" #include "ParagraphParameters.h" @@ -28,13 +26,10 @@ #include "Text.h" #include "TextClass.h" -#include "support/convert.h" -#include "support/debug.h" #include "support/lassert.h" -#include "support/lstrings.h" -#include "support/textutils.h" #include +#include // Uncomment to activate debugging code. // #define XHTML_DEBUG @@ -610,6 +605,8 @@ void xhtmlParagraphs(Text const & text, ParagraphList::const_iterator send; // Think about adding
and/or
s. + // Document title is not in Sectioning, but rather in FrontMatter, so that it does not need to be taken + // into account. if (style.category() == from_utf8("Sectioning")) { int level = style.toclevel; @@ -620,7 +617,7 @@ void xhtmlParagraphs(Text const & text, while (!headerLevels.empty() && level <= headerLevels.top()) { // Output the tag only if it corresponds to a legit section. int stackLevel = headerLevels.top(); - if (stackLevel != Layout::NOT_IN_TOC && level > 1) { //

is the document title. + if (stackLevel != Layout::NOT_IN_TOC) { xs << xml::EndTag("section"); xs << xml::CR(); } @@ -630,7 +627,7 @@ void xhtmlParagraphs(Text const & text, // Open the new section: first push it onto the stack, then output it in XHTML. headerLevels.push(level); // Some sectioning-like elements should not be output (such as FrontMatter). - if (level != Layout::NOT_IN_TOC && level > 1) { //

is the document title. + if (level != Layout::NOT_IN_TOC ) { xs << xml::StartTag("section"); xs << xml::CR(); } @@ -675,10 +672,9 @@ void xhtmlParagraphs(Text const & text, // If need be, close
s, but only at the end of the document (otherwise, dealt with at the beginning // of the loop). - while (!headerLevels.empty() && headerLevels.top() > Layout::NOT_IN_TOC) { - docstring tag = from_utf8("
"); + while (!headerLevels.empty() && headerLevels.top() != Layout::NOT_IN_TOC) { headerLevels.pop(); - xs << XMLStream::ESCAPE_NONE << tag; + xs << xml::EndTag("section"); xs << xml::CR(); } }