Alwinator / asciidoctor-lists

An asciidoctor extension that adds a list of figures, a list of tables, or a list of anything you want!
Mozilla Public License 2.0
39 stars 10 forks source link

broken links for elements without IDs in lists rendered by EPUB3 backend #25

Open meonkeys opened 5 months ago

meonkeys commented 5 months ago

If I generate an EPUB, the lists render properly, but the links don't work unless the blocks have explicit IDs.

Repro source: https://github.com/meonkeys/asciidoctor-lists-repro01/blob/main/book/repro.adoc?plain=1

Repro output EPUB: https://github.com/meonkeys/asciidoctor-lists-repro01/blob/main/REPRO-OUTPUT.epub

Try clicking on the different links in the "Cross references" chapter in an ebook reader.

Figures

Figure 1. An image                    <-- BROKEN
Figure 2. An image with an ID         <-- WORKS

Tables

Table 1. A Made-up table              <-- BROKEN
Table 2. A Made-up table with an ID   <-- WORKS 

Sidebars

A sidebar                             <-- BROKEN
A sidebar with an ID                  <-- WORKS 

Code snippets

Listing 1. A code snippet             <-- BROKEN
Listing 2. A code snippet with an ID  <-- WORKS 

I'm using calibre ebook viewer from calibre 5.37 on ubuntu 22.04 LTS.

If I generate HTML or PDF from that same Asciidoc source the links work as intended.

Note the output of asciidoctor-epub3 includes these warnings:

asciidoctor: WARNING: repro.adoc: invalid reference to unknown anchor: fe7f57ab-a172-4857-aa09-5e0a7c9cb00b
asciidoctor: WARNING: repro.adoc: invalid reference to unknown anchor: aaf0ca38-e48f-4432-b5b6-73f6cb8a8e1d
asciidoctor: WARNING: repro.adoc: invalid reference to unknown anchor: 94294979-2320-4b94-bc00-2da3162abcfe
asciidoctor: WARNING: repro.adoc: invalid reference to unknown anchor: c445093a-10bf-4efb-98b1-36e498958244

Possibly related to https://github.com/asciidoctor/asciidoctor-epub3/issues/317 or one of the other issues in that repro related to cross references, IDs, and linking.