Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asccidoctorj logs multiple "possible invalid reference" #901

Closed
bric3 opened this issue Jan 30, 2020 · 12 comments
Closed

asccidoctorj logs multiple "possible invalid reference" #901

bric3 opened this issue Jan 30, 2020 · 12 comments

Comments

@bric3
Copy link

bric3 commented Jan 30, 2020

I've setup a project that uses asciidoctor-gradle-plugin 3.1.0. And I always get these INFO / warning log messages. I'm not sure those are actual warnings.

> Task :asciidoctor
Jan 30, 2020 3:30:48 PM uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/substitutors.rb sub_macros
INFO: possible invalid reference: numbered
Jan 30, 2020 3:30:48 PM uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/substitutors.rb sub_macros
INFO: possible invalid reference: first
Jan 30, 2020 3:30:48 PM uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/substitutors.rb sub_macros
INFO: possible invalid reference: purpose
Jan 30, 2020 3:30:48 PM uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/substitutors.rb sub_macros
INFO: possible invalid reference: another_term

Here's the setup, I'm using Gradle 6.1.1. As far as I understand asciidoctorj to 2.2.0 still packages the 2.0.10 gem lib.

plugins {
    id 'org.asciidoctor.jvm.convert' version '3.1.0'
}

repositories {
    jcenter()
}

asciidoctor {
    asciidoctorj {
        version '2.2.0'
        modules.diagram.version '2.0.1'
        options doctype: 'book', ruby: 'erubis'
    }

    resources {
        from(sourceDir) {
            include 'images/**'
            include '*.css'
            include 'js/**'
        }
    }

    sources {
        include 'demo.adoc'
    }
    baseDirFollowsSourceDir()

    inputs.files("${sourceDir}/*.css")
    inputs.dir("${sourceDir}/js")
}
@bric3
Copy link
Author

bric3 commented Jan 30, 2020

The only similar issue I've seen is there : https://gitter.im/asciidoctor/asciidoctor?at=5d2b58f63b41924785bb0413

After searching I noticed this commit a04f2cf which forces the logging to verbose, which is probably why I'm seeing those logs in the first place.

The document I'm converting has the references that are being complained about :

[[numbered]]
.Bullet points
. one
. two

[[purpose]]
.Purpose of the tool
****
...
****

[[another_term]]aka::
...

Then reference to <<numbered>> ...

[[first,First Contact]]
== First Contact

Later ... xref:first[] with this <<purpose,Purpose>>.

<<another_term>>

@bric3
Copy link
Author

bric3 commented Jan 30, 2020

After seeing this file (asciidoctor-gradle-plugin 3) and this one I wonder if this is something that is missing onthe gradle plugin.

@mojavelinux
Copy link
Member

And I always get these INFO / warning log messages.

The problems were always there. Asciidoctor 2 just tells you about them now.

@mojavelinux
Copy link
Member

If I try your sample with Asciidoctor core 2.0.11, I don't see any warnings.

asciidoctor -w -v test.adoc

@mojavelinux
Copy link
Member

Your document must be running in compat mode somehow:

asciidoctor -v -a compat-mode test.adoc
asciidoctor: INFO: possible invalid reference: numbered
asciidoctor: INFO: possible invalid reference: first
asciidoctor: INFO: possible invalid reference: purpose
asciidoctor: INFO: possible invalid reference: another_term

But these shouldn't be warnings. I'll look into it.

@mojavelinux
Copy link
Member

Yep, that's a bug in the compat mode logic. The condition is reversed. A valid reference is being logged as an invalid reference. Oops. I'll fix in 2.0.11.

@bric3
Copy link
Author

bric3 commented Jan 30, 2020

thanks

@sgarfinkel
Copy link

sgarfinkel commented Apr 1, 2020

@mojavelinux To clarify, is this an actual issue or can I just ignore it? Encountering the same problem, I assume due to using :sectlinks:

@mojavelinux
Copy link
Member

@sgarfinkel I'd have to see your document to know for sure, but likely these are warnings due to the inverted condition. A fix has been made to the master branch and will be included in the 2.0.11 release.

I assume due to using :sectlinks:

This has nothing to do with sectlinks. That's a setting that affects how section titles are displayed.

@sgarfinkel
Copy link

sgarfinkel commented Apr 2, 2020

Yes, I should have edited my original comment, I was getting a similar warning but it was actually a bug in my asciidoc due to actual invalid references.

@robertpanzer
Copy link
Member

This issue seems to be normal behavior if I understand correctly and is not directly related to AsciidoctorJ.

@mojavelinux
Copy link
Member

..and it was fixed in Asciidoctor core. See asciidoctor/asciidoctor#3555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants