[LyX/master] DocBook: bug fixing with wrapper merging.
Thibaut Cuvelier
tcuvelier at lyx.org
Sat Sep 19 18:18:55 UTC 2020
commit 976bd91fc2bfea65f22babcc7a9f4762a46f7795
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date: Sun Aug 30 03:30:56 2020 +0200
DocBook: bug fixing with wrapper merging.
---
.../docbook/bibliography_precooked_aastex.xml | 22 ++++++++-----------
src/output_docbook.cpp | 15 ++++++++-----
2 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml
index 70b19af..2ab4a79 100644
--- a/autotests/export/docbook/bibliography_precooked_aastex.xml
+++ b/autotests/export/docbook/bibliography_precooked_aastex.xml
@@ -40,16 +40,15 @@
<affiliation role="alternate">
<orgname>Patron, Alonso's Bar and Grill</orgname>
</affiliation>
-<keyword>
-clusters: globular, peanut—bosons: bozos
-</keyword>
-<!-- Output Error: Tried to close `keywordset' when tag was not open. Tag discarded. -->
-
+</author>
+<keywordset>
+<keyword>clusters: globular, peanut—bosons: bozos</keyword>
+</keywordset>
+<abstract>
<para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
+</abstract>
-<!-- Output Error: Closing tag `info' when other tags are open, namely: -->
-<!-- Output Error: author -->
-</author></info>
+</info>
<section>
<title>Introduction</title>
<para>A focal problem today in the dynamics of globular clusters is core collapse. It has been predicted by theory for decades <biblioref endterm="hen61" />, <biblioref endterm="lyn68" />, <biblioref endterm="spi85" />, but observation has been less alert to the phenomenon. For many years the central brightness peak in M15 <biblioref endterm="kin75" />, <biblioref endterm="new78" /> seemed a unique anomaly. Then <biblioref endterm="aur82" /> suggested a central peak in NGC 6397, and a limited photographic survey of ours <biblioref endterm="djo84" /> found three more cases, including NGC 6624, whose sharp center had often been remarked on <biblioref endterm="can78" />. </para>
@@ -1005,11 +1004,8 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
</inlineequation> of the electronically submitted abstracts for AAS meetings are error-free. </para>
<acknowledgements>
<para>We are grateful to V. Barger, T. Han, and R. J. N. Phillips for doing the math in section <xref linkend="bozomath" />. More information on the AASTeX macros package are available at <link xlink:href="http://www.aas.org/publications/aastex">http://www.aas.org/publications/aastex</link> or the <link xlink:href="ftp://www.aas.org/pubs/AAS ftp site">AAS ftp site</link>.</para>
-<application>
-IRAF, AIPS, Astropy, ...
-</application>
-<!-- Output Error: Tried to close `para' when tag was not open. Tag discarded. -->
-
+</acknowledgements>
+<remark role='software'>IRAF, AIPS, Astropy, ...</remark>
</section>
<bibliography>
<bibliomixed xml:id='aur82'>Aurière, M. 1982, <!-- \aap -->
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 19bd1d8..2bffb0a 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -274,8 +274,10 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
if (prevpar != nullptr) {
Layout const & prevlay = prevpar->layout();
if (prevlay.docbookwrappertag() != "NONE") {
- openWrapper = prevlay.docbookwrappertag() == lay.docbookwrappertag()
- && !lay.docbookwrappermergewithprevious();
+ if (prevlay.docbookwrappertag() == lay.docbookwrappertag())
+ openWrapper = !lay.docbookwrappermergewithprevious();
+ else
+ openWrapper = true;
}
}
@@ -308,8 +310,10 @@ void closeParTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpa
if (nextpar != nullptr) {
Layout const & nextlay = nextpar->layout();
if (nextlay.docbookwrappertag() != "NONE") {
- closeWrapper = nextlay.docbookwrappertag() == lay.docbookwrappertag()
- && !nextlay.docbookwrappermergewithprevious();
+ if (nextlay.docbookwrappertag() == lay.docbookwrappertag())
+ closeWrapper = !nextlay.docbookwrappermergewithprevious();
+ else
+ closeWrapper = true;
}
}
@@ -948,8 +952,7 @@ void outputDocBookInfo(
// that mandating a wrapper like <info> would repel users. Thus, generate them first.
makeAny(text, buf, xs, runparams, paragraphs.iterator_at(pit));
for (auto pit : info.mustBeInInfo)
- if (info.abstract.find(pit) == info.abstract.end()) // The abstract must be in info, but is dealt with after.
- makeAny(text, buf, xs, runparams, paragraphs.iterator_at(pit));
+ makeAny(text, buf, xs, runparams, paragraphs.iterator_at(pit));
// Always output the abstract as the last item of the <info>, as it requires special treatment (especially if
// it contains several paragraphs that are empty).
More information about the lyx-cvs
mailing list