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 directive on first line of AsciiDoc table cell #4571
Comments
The reason is a bit more complicated than this. An AsciiDoc table cell is permitted to start directly after a cell separator rather than on the next line. In this situation, an artificial line is created that has no cursor information. As a result, if there's a warning or error that occurs on that line, then it is missing cursor information. Had the include directive been moved to the next line, the line information would have been correct. I need to see if I can create a synthetic cursor for this first line so that any error or warning that occurs on that first line is reported properly. |
The proposed fixed just happens to work (we got lucky). |
… first line of AsciiDoc table cell
Btw, we always recommend starting the contents of an AsciiDoc table cell on the following line. It's a convenience that it is allowed to start on the same line as the cell separator, but not recommended. |
… first line of AsciiDoc table cell
…rst line of AsciiDoc table cell
Example asciidoc file:
Expectation
Expected output (simplified HTML):
Expected errors:
Reality
Actual output (simplified HTML):
Actual errors:
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.
The text was updated successfully, but these errors were encountered: