From 51939801f5ef305fc38d15b4ac86d85f4dd5aab4 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Mon, 20 Jul 2020 02:47:40 +0200 Subject: [PATCH] DocBook: better handling of paragraphs containing notes in the abstract. --- src/output_docbook.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index d29362eb51..e1df2cc2d3 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -669,7 +669,15 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const ¶graphs, pit_type c pit_type cpit = bpit; while (cpit < epit) { - Layout const &style = paragraphs[cpit].layout(); + // Skip paragraphs only containing one note. + Paragraph const &par = paragraphs[cpit]; + if (par.size() == 1 && dynamic_cast(paragraphs[cpit].insetList().get(0))) { + cpit += 1; + continue; + } + + // Based on layout information, store this paragraph in one set: should be in , must be. + Layout const &style = par.layout(); if (style.docbookininfo() == "always") { mustBeInInfo.emplace(cpit); } else if (style.docbookininfo() == "maybe") { @@ -680,7 +688,8 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const ¶graphs, pit_type c } cpit += 1; } - // Now, bpit points to the last paragraph that has things that could go in . + // Now, cpit points to the last paragraph that has things that could go in . + // bpit is still the beginning of the part. return make_tuple(shouldBeInInfo, mustBeInInfo, bpit, cpit); }