asciidoctor-gradle-plugin icon indicating copy to clipboard operation
asciidoctor-gradle-plugin copied to clipboard

False positives for "possible invalid reference"

Open Buzzardo opened this issue 5 years ago • 1 comments

When I run the asciidoctor task, I get a bunch of false positives, as follows:

uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/converter/html5.rb convert_document INFO: possible invalid reference: junit

junit is a valid reference, defined as [[junit]] in an included file. The link in the finished document works.

I noticed that, when I left id 'org.asciidoctor.jvm.gems' version '3.1.0' out of the plugins section of the build file, the PDF converter didn't provide any invalid reference warnings. When I do include it, the PDF converter correctly identifies invalid references and does not create the false positives.

I thought you might want to investigate the differences between the reference checker in 'org.asciidoctor.jvm.gems' version '3.1.0' and the one in 'org.asciidoctor.jvm.convert' version '3.1.0'.

You can find the build file in this commit: https://github.com/spring-projects/spring-kafka/pull/1469/commits/2485c65a32ec71ebe3e7a67b85de67d662e26583

Buzzardo avatar Apr 28 '20 17:04 Buzzardo

This is a known limitation in Asciidoctor. Since Asciidoctor does not fully parse the document up front, it has no way of knowing for certain whether certain references are present or not. That's why the message includes the adjective "possible". It just doesn't know. The warnings are enabled when the log level is set to INFO or higher.

See https://github.com/asciidoctor/asciidoctor/issues/2722 for upstream issue

mojavelinux avatar Oct 11 '23 09:10 mojavelinux