DocBook: fix font issues when a paragraph has an InsetNewline.

This commit is contained in:
Thibaut Cuvelier 2020-08-30 23:38:40 +02:00
parent 7a1b82a16a
commit 9d3a717ef1
4 changed files with 15 additions and 19 deletions

View File

@ -4,9 +4,10 @@
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
<info>
<title>Title</title>
<author><personname>Author</personname></author>
<author>
<personname>Author</personname>
</author>
<date>Date</date>
</info>
<para>Content</para>
</article>

View File

@ -7,22 +7,19 @@
<variablelist>
<varlistentry>
<term>LyX:</term>
<listitem>
<para />
<variablelist>
<varlistentry>
<term>lyx16</term>
<listitem>
<para> LyX 1.6 file format (lyx2lyx)</para>
<para>LyX 1.6 file format (lyx2lyx)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>lyx21</term>
<listitem>
<para> </para>
<para />
</listitem>
</varlistentry>
</variablelist>
@ -30,27 +27,23 @@
</varlistentry>
<varlistentry>
<term>LyX:</term>
<listitem>
<para />
<variablelist>
<varlistentry>
<term>lyx16</term>
<listitem>
<para> LyX 1.6 file format (lyx2lyx)</para>
<para>LyX 1.6 file format (lyx2lyx)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>lyx21</term>
<listitem>
<para> </para>
<para />
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</article>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This DocBook file was created by LyX 2.4.0dev
See http://www.lyx.org/ for more information -->
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.1">
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
<title>Test document</title>
<itemizedlist>
<listitem>
@ -9,5 +9,4 @@
<para>Content.</para>
</listitem>
</itemizedlist>
</article>
</article>

View File

@ -3358,12 +3358,15 @@ std::vector<docstring> Paragraph::simpleDocBookOnePar(Buffer const & buf,
if (isDeleted(i))
continue;
// If this is an InsetNewline, generate a new paragraph.
// If this is an InsetNewline, generate a new paragraph. Also reset the fonts, so that tags are closed in
// this paragraph.
if (getInset(i) != nullptr && getInset(i)->lyxCode() == NEWLINE_CODE) {
xs->closeFontTags();
generatedParagraphs.push_back(os.str());
os = odocstringstream();
delete xs;
xs = new XMLStream(os);
font_old = outerfont.fontInfo();
}
// Determine which tags should be opened or closed.