From 3263d0d7c4052307ce38f342800197dec5a3fba0 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 29 Oct 2017 21:46:44 +0300 Subject: Write FB2 lists without nesting blocks inside

(#4004) According to FB2 XML schema cannot be placed inside

. Linux FBReader can't display such paragraphs, e.g. any "loose" lists produced by pandoc prior to this commit. Besides that, FB2 writer placed

inside

when writing nested lists, this commit fixes the bug. Also this commit removes leading non-breaking space from ordered lists for consistency with bullet lists. Definition lists are not affected at all. --- test/writer.fb2 | 168 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 86 insertions(+), 82 deletions(-) (limited to 'test/writer.fb2') diff --git a/test/writer.fb2 b/test/writer.fb2 index 63d0bdfbf..8a4986508 100644 --- a/test/writer.fb2 +++ b/test/writer.fb2 @@ -115,8 +115,8 @@

A list:

-

 1. item one

-

 2. item two

+

1. item one

+

2. item two

Nested block quotes:

nested

@@ -191,127 +191,131 @@

• asterisk 2

• asterisk 3

Asterisks loose:

-

• asterisk 1 -

-

• asterisk 2 -

-

• asterisk 3 -

+

• asterisk 1

+ +

• asterisk 2

+ +

• asterisk 3

+

Pluses tight:

• Plus 1

• Plus 2

• Plus 3

Pluses loose:

-

• Plus 1 -

-

• Plus 2 -

-

• Plus 3 -

+

• Plus 1

+ +

• Plus 2

+ +

• Plus 3

+

Minuses tight:

• Minus 1

• Minus 2

• Minus 3

Minuses loose:

-

• Minus 1 -

-

• Minus 2 -

-

• Minus 3 -

+

• Minus 1

+ +

• Minus 2

+ +

• Minus 3

+
<p>Ordered</p>

Tight:

-

 1. First

-

 2. Second

-

 3. Third

+

1. First

+

2. Second

+

3. Third

and:

-

 1. One

-

 2. Two

-

 3. Three

+

1. One

+

2. Two

+

3. Three

Loose using tabs:

-

 1. First -

-

 2. Second -

-

 3. Third -

+

1. First

+ +

2. Second

+ +

3. Third

+

and using spaces:

-

 1. One -

-

 2. Two -

-

 3. Three -

+

1. One

+ +

2. Two

+ +

3. Three

+

Multiple paragraphs:

-

 1. Item 1, graf one.Item 1. graf two. The quick brown fox jumped over the lazy dog’s back. -

-

 2. Item 2. -

-

 3. Item 3. -

+

1. Item 1, graf one.

+ +

   Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.

+ +

2. Item 2.

+ +

3. Item 3.

+
<p>Nested</p> -

• Tab

◦ Tab

* Tab

-

-

+

• Tab

+

◦ Tab

+

* Tab

Here’s another:

-

 1. First

-

 2. Second:

   • Fee

+

1. First

+

2. Second:

+

   • Fee

   • Fie

   • Foe

-

-

 3. Third

+

3. Third

Same thing but with paragraphs:

-

 1. First -

-

 2. Second: +

1. First

+ +

2. Second:

+

   • Fee

   • Fie

   • Foe

-

-

 3. Third -

+

3. Third

+
<p>Tabs and spaces</p> -

• this is a list item indented with tabs -

-

• this is a list item indented with spaces -

◦ this is an example list item indented with tabs -

-

◦ this is an example list item indented with spaces -

-

+

• this is a list item indented with tabs

+ +

• this is a list item indented with spaces

+ +

◦ this is an example list item indented with tabs

+ +

◦ this is an example list item indented with spaces

+
<p>Fancy list markers</p> -

 (2) begins with 2

-

 (3) and now 3with a continuation -

 (3) iv. sublist with roman numerals, starting with 4

-

 (3) v. more items

 (3) v. (A) a subsublist

-

 (3) v. (B) a subsublist

-

-

+

(2) begins with 2

+

(3) and now 3

+ +

    with a continuation

+ +

(3) iv. sublist with roman numerals, starting with 4

+

(3) v. more items

+

(3) v. (A) a subsublist

+

(3) v. (B) a subsublist

Nesting:

-

 A. Upper Alpha

 A. I. Upper Roman.

 A. I. (6) Decimal start with 6

 A. I. (6) c) Lower alpha with paren

-

-

-

+

A. Upper Alpha

+

A. I. Upper Roman.

+

A. I. (6) Decimal start with 6

+

A. I. (6) c) Lower alpha with paren

Autonumbering:

-

 1. Autonumber.

-

 2. More.

 2. 1. Nested.

-

+

1. Autonumber.

+

2. More.

+

2. 1. Nested.

Should not be a list item:

M.A. 2007

B. Williams

@@ -427,8 +431,8 @@ orange

    orange fruit -

 1. sublist

-

 2. sublist

+

1. sublist

+

2. sublist

@@ -753,7 +757,7 @@

-

 1. And in list items. +

1. And in list items. [32]

-- cgit v1.2.3