]> git.lyx.org Git - features.git/commitdiff
DocBook: fix appendices.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Fri, 27 Nov 2020 01:50:03 +0000 (02:50 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Fri, 27 Nov 2020 01:50:03 +0000 (02:50 +0100)
src/output_docbook.cpp

index 0deed246634fe7d3119f870be6a50cb9d5c67156..214c2a83ececd0c0723fd25a9f186cda6d467a98 100644 (file)
@@ -1101,7 +1101,7 @@ void docbookParagraphs(Text const &text,
                Layout const &style = par->layout();
 
                // Think about adding <section> and/or </section>s.
-               if (isLayoutSectioning(style)) {
+               if (isLayoutSectioning(style) || par->params().startOfAppendix()) {
                        int level = style.toclevel;
 
                        // Need to close a previous section if it has the same level or a higher one (close <section> if opening a
@@ -1122,8 +1122,7 @@ void docbookParagraphs(Text const &text,
                        }
 
                        // Open the new section: first push it onto the stack, then output it in DocBook.
-                       string sectionTag = (currentlyInAppendix && style.docbooksectiontag() == "chapter") ?
-                                                               "appendix" : style.docbooksectiontag();
+                       string sectionTag = (par->params().startOfAppendix()) ? "appendix" : style.docbooksectiontag();
                        headerLevels.push(std::make_pair(level, sectionTag));
 
                        // Some sectioning-like elements should not be output (such as FrontMatter).