X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_docbook.C;h=2778dde86e67a77fc57fe57bb959ead634675c51;hb=52eb91c94fb70d58dceef430659c8781de2eccda;hp=cb5ec45481dac8ea211d819230870cf5c09d8fa8;hpb=e68d69e4739b5b9811120889fbc5147aad25e41f;p=lyx.git diff --git a/src/output_docbook.C b/src/output_docbook.C index cb5ec45481..2778dde86e 100644 --- a/src/output_docbook.C +++ b/src/output_docbook.C @@ -167,7 +167,13 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, sgml::closeTag(os, bstyle->labeltag()); } wrapper = defaultstyle->latexname(); - sgml::openTag(os, bstyle->itemtag()); + // If a sub list (embedded list) appears next with a + // different depth, then there is no need to open + // another tag at the current depth. + if(par->params().depth() == pbegin->params().depth()) { + sgml::openTag(os, bstyle->itemtag()); + } + break; default: break; } @@ -204,7 +210,17 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, } break; case LATEX_ITEM_ENVIRONMENT: - sgml::closeTag(os, bstyle->itemtag()); + // If a sub list (embedded list) appears next, then + // there is no need to close the current tag. + // par should have already been incremented to the next + // element. So we can compare the depth of the next + // element with pbegin. + // We need to be careful, that we don't dereference par + // when par == pend but at the same time that the + // current tag is closed. + if((par != pend && par->params().depth() == pbegin->params().depth()) || par == pend) { + sgml::closeTag(os, bstyle->itemtag()); + } if (!bstyle->labeltag().empty()) sgml::closeTag(os, bstyle->innertag()); break;