asciidoctor-gradle-plugin
asciidoctor-gradle-plugin copied to clipboard
False positives for "possible invalid reference"
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
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