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

Fix error message from include macros within tables #4571

Open
mblythe86 opened this issue Mar 26, 2024 · 0 comments · May be fixed by #4572
Open

Fix error message from include macros within tables #4571

mblythe86 opened this issue Mar 26, 2024 · 0 comments · May be fixed by #4572
Milestone

Comments

@mblythe86
Copy link

Example asciidoc file:

== Testing an include within a table

include::does_not_exist.adoc[]

|===
| *A* | *B*

| some text a| include::does_not_exist.adoc[]
|===

Expectation

Expected output (simplified HTML):

Testing an include within a table

Unresolved directive in table_include.adoc - include::does_not_exist.adoc[]

A B

some text

Unresolved directive in table_include.adoc - include::does_not_exist.adoc[]

Expected errors:

asciidoctor: ERROR: table_include.adoc: line 3: include file not found: /path/to/does_not_exist.adoc
asciidoctor: ERROR: table_include.adoc: line 8: include file not found: /path/to/does_not_exist.adoc

Reality

Actual output (simplified HTML):

Testing an include within a table

Unresolved directive in table_include.adoc - include::does_not_exist.adoc[]

A B

some text

Unresolved directive in <stdin> - include::does_not_exist.adoc[]

Actual errors:

asciidoctor: ERROR: table_include.adoc: line 3: include file not found: /path/to/does_not_exist.adoc
asciidoctor: ERROR: <stdin>: line 1: include file not found: /path/to/does_not_exist.adoc

Details

This poor error message makes it more difficult to identify the location of the error. Fixing this would enable users to more quickly identify and fix problems in their asciidoc files.

Tested using asciidoctor v2.0.16, but I am confident that the issue persists in v2.0.22 because I've root caused the problem to this line of code. The PreprocessorReader constructor accepts an optional 3rd parameter, cursor, that provides the details of what file is being parsed and the location within that file, and that is not being provided here.

Shortly, I'll submit a simple pull request to fix this issue.

mblythe86 added a commit to mblythe86/asciidoctor that referenced this issue Mar 26, 2024
@mojavelinux mojavelinux added this to the v2.0.x milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants