From f9aa2eb35368724609ba624f00aed8d033159fcf Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 7 Apr 2018 00:50:02 +0300 Subject: FB2 writer: output links inline instead of producing notes Previously all links were turned into footnotes with unclickable URLs inside. --- test/writer.fb2 | 381 +++++++++----------------------------------------------- 1 file changed, 58 insertions(+), 323 deletions(-) (limited to 'test/writer.fb2') diff --git a/test/writer.fb2 b/test/writer.fb2 index 2136a6d8e..ceebac65c 100644 --- a/test/writer.fb2 +++ b/test/writer.fb2 @@ -33,9 +33,7 @@
-<p>Level 2 with an embedded link<a l:href="#l1" type="note"> -<sup>[1]</sup> -</a> +<p>Level 2 with an <a l:href="/url">embedded link</a> </p>
@@ -490,9 +488,8 @@

This is emphasized, and so is this.

This is strong, and so is this.

-

An emphasized link -[2] - +

An +emphasized link .

@@ -531,9 +528,7 @@

‘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 -[3] -”.

+

Here is some quoted ‘code’ and a “quoted link”.

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

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

Ellipses…and…and….

@@ -611,112 +606,71 @@ <p>Explicit</p> -

Just a URL -[4] -.

-

URL and title -[5] -.

-

URL and title -[6] -.

-

URL and title -[7] -.

-

URL and title -[8] - +

Just a URL.

+

+URL and title.

+

+URL and title.

+

+URL and title.

+

+URL and title

-

URL and title -[9] - +

+URL and title

-

with_underscore -[10] - +

+with_underscore

-

Email link -[11] - +

+Email link

-

Empty -[12] -.

+

+Empty.

<p>Reference</p> -

Foo bar -[13] -.

-

With embedded [brackets] -[14] -.

-

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

-

Indented once -[16] -.

-

Indented twice -[17] -.

-

Indented thrice -[18] -.

+

Foo bar.

+

With embedded [brackets].

+

+b by itself should be a link.

+

Indented once.

+

Indented twice.

+

Indented thrice.

This should [not][] be a link.

[not]: /url

-

Foo bar -[19] -.

-

Foo biz -[20] -.

+

Foo bar.

+

Foo biz.

<p>With ampersands</p> -

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

-

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

-

Here’s an inline link -[23] -.

-

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

+

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

+

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

+

Here’s an inline link.

+

Here’s an inline link in pointy braces.

<p>Autolinks</p> -

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

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

• In a list?

-

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

• http://example.com/

• It should.

-

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

An e-mail address: nobody@nowhere.net

-

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

Blockquoted: http://example.com/

Auto-links should not occur here: <http://example.com/> @@ -746,254 +700,37 @@ <p>Footnotes</p> -

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

Here is a footnote reference, +[1] + and another. +[2] + This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note. +[3]

-

Notes can go in quotes. -[32] +

Notes can go in quotes. +[4]

-

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

1. And in list items. +[5]

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

-
+
<p>1</p> -

-/url -

-
-
- -<p>2</p> - -

-/url -

-
-
- -<p>3</p> - -

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

-
-
- -<p>4</p> - -

-/url/ -

-
-
- -<p>5</p> - -

title: /url/ -

-
-
- -<p>6</p> - -

title preceded by two spaces: /url/ -

-
-
- -<p>7</p> - -

title preceded by a tab: /url/ -

-
-
- -<p>8</p> - -

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

-
-
- -<p>9</p> - -

title with single quotes: /url/ -

-
-
- -<p>10</p> - -

-/url/with_underscore -

-
-
- -<p>11</p> - -

-mailto:nobody@nowhere.net -

-
-
- -<p>12</p> - -

- - -

-
-
- -<p>13</p> - -

-/url/ -

-
-
- -<p>14</p> - -

-/url/ -

-
-
- -<p>15</p> - -

-/url/ -

-
-
- -<p>16</p> - -

-/url -

-
-
- -<p>17</p> - -

-/url -

-
-
- -<p>18</p> - -

-/url -

-
-
- -<p>19</p> - -

Title with "quotes" inside: /url/ -

-
-
- -<p>20</p> - -

Title with "quote" inside: /url/ -

-
-
- -<p>21</p> - -

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

-
-
- -<p>22</p> - -

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

-
-
- -<p>23</p> - -

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

-
-
- -<p>24</p> - -

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

-
-
- -<p>25</p> - -

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

-
-
- -<p>26</p> - -

-http://example.com/ -

-
-
- -<p>27</p> - -

-mailto:nobody@nowhere.net -

-
-
- -<p>28</p> - -

-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> +<p>2</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).

@@ -1004,23 +741,21 @@

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

-
+
-<p>31</p> +<p>3</p> -

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

+

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

-
+
-<p>32</p> +<p>4</p>

In quote.

-
+
-<p>33</p> +<p>5</p>

In list.

-- cgit v1.2.3