From ff3ed5c9f8ee985bb6026dd10b8c2549782c0296 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Wed, 4 Apr 2018 13:45:28 +0300 Subject: FB2 writer: allow emphasis and notes in titles Only

and are allowed in titles, but

has the same type as an ordinary paragraphs. Therefore, there is no need to remove emphasis from titles. Also, don't intersperse paragraph with empty lines. --- test/writer.fb2 | 188 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 101 insertions(+), 87 deletions(-) (limited to 'test/writer.fb2') diff --git a/test/writer.fb2 b/test/writer.fb2 index 20f566334..2136a6d8e 100644 --- a/test/writer.fb2 +++ b/test/writer.fb2 @@ -33,11 +33,15 @@

-<p>Level 2 with an embedded link </url></p> +<p>Level 2 with an embedded link<a l:href="#l1" type="note"> +<sup>[1]</sup> +</a> +</p>
-<p>Level 3 with emphasis</p> +<p>Level 3 with <emphasis>emphasis</emphasis> +</p>
@@ -58,7 +62,8 @@
-<p>Level 2 with emphasis</p> +<p>Level 2 with <emphasis>emphasis</emphasis> +</p>
@@ -485,8 +490,8 @@

This is emphasized, and so is this.

This is strong, and so is this.

-

An emphasized link -[1] +

An emphasized link +[2] .

@@ -526,8 +531,8 @@

‘A’, ‘B’, and ‘C’ are letters.

‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’

‘He said, “I want to go.”’ Were you alive in the 70’s?

-

Here is some quoted ‘code’ and a “quoted link -[2] +

Here is some quoted ‘code’ and a “quoted link +[3] ”.

Some dashes: one—two — three—four — five.

Dashes between numbers: 5–7, 255–66, 1987–1999.

@@ -606,10 +611,7 @@ <p>Explicit</p> -

Just a URL -[3] -.

-

URL and title +

Just a URL [4] .

URL and title @@ -620,97 +622,100 @@ .

URL and title [7] - -

+.

URL and title [8]

-

with_underscore +

URL and title [9]

-

Email link +

with_underscore [10]

-

Empty +

Email link [11] + +

+

Empty +[12] .

<p>Reference</p> -

Foo bar -[12] -.

-

With embedded [brackets] +

Foo bar [13] .

-

b +

With embedded [brackets] [14] - by itself should be a link.

-

Indented once -[15] .

-

Indented twice +

b +[15] + by itself should be a link.

+

Indented once [16] .

-

Indented thrice +

Indented twice [17] .

+

Indented thrice +[18] +.

This should [not][] be a link.

[not]: /url

-

Foo bar -[18] -.

-

Foo biz +

Foo bar [19] .

+

Foo biz +[20] +.

<p>With ampersands</p> -

Here’s a link with an ampersand in the URL -[20] -.

-

Here’s a link with an amersand in the link text: AT&T +

Here’s a link with an ampersand in the URL [21] .

-

Here’s an inline link +

Here’s a link with an amersand in the link text: AT&T [22] .

-

Here’s an inline link in pointy braces +

Here’s an inline link [23] .

+

Here’s an inline link in pointy braces +[24] +.

<p>Autolinks</p> -

With an ampersand: http://example.com/?foo=1&bar=2 -[24] +

With an ampersand: http://example.com/?foo=1&bar=2 +[25]

• In a list?

-

• http://example.com/ -[25] +

• http://example.com/ +[26]

• It should.

-

An e-mail address: nobody@nowhere.net -[26] +

An e-mail address: nobody@nowhere.net +[27]

-

Blockquoted: http://example.com/ -[27] +

Blockquoted: http://example.com/ +[28]

@@ -741,22 +746,22 @@ <p>Footnotes</p> -

Here is a footnote reference, -[28] - and another. +

Here is a footnote reference, [29] - This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note. + and another. [30] + This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note. +[31]

-

Notes can go in quotes. -[31] +

Notes can go in quotes. +[32]

-

1. And in list items. -[32] +

1. And in list items. +[33]

This paragraph should not be part of the note, as it is not indented.

@@ -776,7 +781,7 @@

2

-http://example.com/?foo=1&bar=2 +/url

@@ -784,50 +789,50 @@

3

-/url/ +http://example.com/?foo=1&bar=2

<p>4</p> -

title: /url/ +

+/url/

<p>5</p> -

title preceded by two spaces: /url/ +

title: /url/

<p>6</p> -

title preceded by a tab: /url/ +

title preceded by two spaces: /url/

<p>7</p> -

title with "quotes" in it: /url/ +

title preceded by a tab: /url/

<p>8</p> -

title with single quotes: /url/ +

title with "quotes" in it: /url/

<p>9</p> -

-/url/with_underscore +

title with single quotes: /url/

@@ -835,7 +840,7 @@

10

-mailto:nobody@nowhere.net +/url/with_underscore

@@ -843,8 +848,7 @@

11

- - +mailto:nobody@nowhere.net

@@ -852,7 +856,8 @@

12

-/url/ + +

@@ -876,7 +881,7 @@

15

-/url +/url/

@@ -899,37 +904,37 @@ <p>18</p> -

Title with "quotes" inside: /url/ +

+/url

<p>19</p> -

Title with "quote" inside: /url/ +

Title with "quotes" inside: /url/

<p>20</p> -

-http://example.com/?foo=1&bar=2 +

Title with "quote" inside: /url/

<p>21</p> -

AT&T: http://att.com/ +

+http://example.com/?foo=1&bar=2

<p>22</p> -

-/script?foo=1&bar=2 +

AT&T: http://att.com/

@@ -945,7 +950,7 @@

24

-http://example.com/?foo=1&bar=2 +/script?foo=1&bar=2

@@ -953,7 +958,7 @@

25

-http://example.com/ +http://example.com/?foo=1&bar=2

@@ -961,7 +966,7 @@

26

-mailto:nobody@nowhere.net +http://example.com/

@@ -969,19 +974,27 @@

27

-http://example.com/ +mailto:nobody@nowhere.net

-
+
<p>28</p> -

Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.

+

+http://example.com/ +

<p>29</p> +

Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.

+
+
+ +<p>30</p> +

Here’s the long note. This one contains multiple blocks.

Subsequent blocks are indented to show that they belong to the footnote (as with list items).

@@ -991,25 +1004,26 @@

If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.

-
+
-<p>30</p> +<p>31</p> -

This is easier to type. Inline notes may contain links -[30] +

This is easier to type. Inline notes may contain links +[31] and ] verbatim characters, as well as [bracketed text].

-
+
-<p>31</p> +<p>32</p>

In quote.

-
+
-<p>32</p> +<p>33</p>

In list.

+ -- cgit v1.2.3