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

INFO: possible invalid reference: #13

Closed cgoguyer closed 2 years ago

cgoguyer commented 2 years ago

Hello,

I'm using gradle and asciidoctor-2.0.17 with asciidoctor-lists:1.0.8. It works fine but I'm getting this INFO message for each link generated (figures and tables). How to correct that or hide these messages?

Thx.

Converting /Users/christophe/Documentation/docRA/src/ra.adoc
Aug 09, 2022 7:31:13 PM /Users/christophe/Documentation/docRA/build/.asciidoctorGems/gems/asciidoctor-2.0.17/lib/asciidoctor/converter/html5.rb convert_paragraph
INFO: possible invalid reference: 32a93281-f075-44ac-8fa3-a9dfb218bbb3
Aug 09, 2022 7:31:13 PM /Users/christophe/Documentation/docRA/build/.asciidoctorGems/gems/asciidoctor-2.0.17/lib/asciidoctor/converter/html5.rb convert_paragraph
INFO: possible invalid reference: 111fc065-8fa0-47d3-9989-063e02146337
Aug 09, 2022 7:31:13 PM /Users/christophe/Documentation/docRA/build/.asciidoctorGems/gems/asciidoctor-2.0.17/lib/asciidoctor/converter/html5.rb convert_paragraph
Alwinator commented 2 years ago

Thanks for the bug report. I will take a look at it next week.

Alwinator commented 2 years ago

@cgoguyer This is a new feature of Asciidoctor added in version 2.0.0. Based on the official documentation it only indicated that:

The processor could not validate the internal reference named <x>. This message doesn’t definitively indicate a missing reference. Rather, it indicates the reference (i.e., anchor) is not in a location where the reference can be validated.

You cannot turn off this specific warning, however, you can turn off warnings in general by removing the -w flag as described here.

RandomCore commented 7 months ago

When substituting the references it is checked, if the references are in the :refs asset, which they don't, if the extension created them (line 49). So plainly adding them to :refs, fixes it: document.catalog[:refs][element.id] = element

Alwinator commented 7 months ago

@RandomCore Very good to know! Thank you! It would be cool if you could create a Pull Request for that. ;)

RandomCore commented 7 months ago

PR is open