[LyX/master] DocBook: more robust list implementation.

Thibaut Cuvelier tcuvelier at lyx.org
Fri Oct 30 00:30:56 UTC 2020


commit da6e999fc6ea76143bdffcf3170407c786dcd3dd
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Oct 26 05:11:59 2020 +0100

    DocBook: more robust list implementation.
---
 src/output_docbook.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 5b30336..74904e1 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -625,9 +625,14 @@ ParagraphList::const_iterator makeListEnvironment(Text const &text,
 
 	// Handle the content of the list environment, item by item.
 	while (par != envend) {
-		Layout const & style = par->layout();
+		// Skip this paragraph if it is both empty and the last one (otherwise, there may be deeper paragraphs after).
+		auto nextpar = par;
+		++nextpar;
+		if (par->empty() && nextpar == envend)
+			break;
 
 		// Open the item wrapper.
+		Layout const & style = par->layout();
 		openTag(xs, style.docbookitemwrappertag(), style.docbookitemwrapperattr(), style.docbookitemwrappertagtype());
 
 		// Generate the label, if need be. If it is taken from the text, sep != 0 and corresponds to the first


More information about the lyx-cvs mailing list