-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Parsing an inline link causes processor to crash for certain matches #1732
Comments
This is the same issue as asciidoctor/asciidoctor#4570 and has been fixed in the upstream. The xref shorthand you showed is not technically valid. That's requesting that the target of an internal xref be a URL, which doesn't make any sense. I'm curious where you are getting this syntax from. |
It was a completely unexpected error, so the code had no way to anticipate it and log a better message. It was an unintended side effect of fixing another issue. We try to make clear error messages when we can anticipate the fault. |
I believe this issue has been fixed upstream: asciidoctor/asciidoctor#4570 We need to release a new Asciidoctor.js version based on Asciidoctor (Ruby) 2.0.28. This error in Java would be a NullPointerException and since the JavaScript code is transpiled from Ruby it does not make it easier to decipher. |
2.0.23 |
Yep, 2.0.23! Sorry I'm on mobile and I mixed up the numbers 🫠 |
- Use the latest Antora Maven Plugin - Switch to package.json (this allows dependabot to update the versions) - Also works around asciidoctor/asciidoctor.js#1732 by by forcing the asciidoctor.js version to previous release
- Use the latest Antora Maven Plugin - Switch to package.json (this allows dependabot to update the versions) - Also works around asciidoctor/asciidoctor.js#1732 by by forcing the asciidoctor.js version to previous release
Thank you for the quick responses!
Thank you. I understand it is an invalid syntax. The difficulty is that the error message provides no clue as to what happened (more on this later).
The error happened in May of 2022 as a part of a contribution. My best guess is that it was just an honest mistake and wasn't gotten from anywhere in particular.
I think that for unexpected error, the message is fine. However, I think that it would be useful to provide more context to troubleshoot unexpected errors. Perhaps this should be another ticket(s) and possibly in Asciidoctor and/or Antora, but I wonder:
Having this information would have made this much easier to figure out what was happening. A little context for how the error was encountered might be helpful. In this particular case, Spring Batch had not made any changes to the documentation or its docs build, so it was surprising when the error started. This also made it difficult to figure out what was causing the error because there wasn't a diff in spring batch that could be used to help isolate the problem. I'd like to start by stating that I'm very novice with JavaScript, so my assessment was a bit difficult to do, but also may be incorrect. I believe that the error started because Antora brings in asciidoctor ~2.2 which means that when asciidoctor.js 2.2.7 was released in March, the Spring Batch build started using asciidoctor.js 2.2.7 and the build started failing despite having worked for months with the same build and docs. If this is true, I have a few questions:
|
Thanks for clarifying. I was just asking in case we had some stray documentation somewhere that I needed to track down.
Again, it should never have crashed that way it did. It was completely unexpected and therefore not possible to handle. We already do all the things you are suggesting when we can anticipate an error. But the code actually has to make it to the error handler. In this case, it just didn't make it that far and crashed earlier. There's nothing we can do when the program fails in this way because the runtime stops. I think you are harping on a very unfortunate situation. This should never have happened in a patch release. But it did. And we did our best to address it as quickly as we could in Asciidoctor core. Given the syntax was so rare, I did not anticipate it affecting Antora. But it did. So now another release (this time of Asciidoctor.js) is warranted. We have a ridiculous number of tests and, in this case, it still slipped through. More tests are always needed, so it just emphasizes why we need to keep prioritizing them. I don't really find further discussion on this issue to be productive. We know what happened and we fixed it. The next step is to push out an Asciidoctor.js release to pick up the upstream fix so that Antora benefits from it as well. |
We intentionally removed the exact dependency on Asciidoctor.js in Antora and switched it to the latest of the preferred minor (2.2). We made an assumption that that time that a patch release should never introduce a problem and allows Antora to benefit from the patch update immediately without a new release. Due to a very unlucky situation, it did (but still limited to invalid and very esoteric AsciiDoc syntax). I'm not going to change the policy in Antora because of what happened. I still think my reasoning for using |
I did some more thinking about this and I've come to realize that there is more we can do in Antora to improve the log message when a situation like this occurs. I've opened the following issue to track this improvement: https://gitlab.com/antora/antora/-/issues/1123 Let's continue the discussion there as it pertains to Antora. |
Asciidoctor.js 2.2.8 is out, could you please try again? |
I verified the fix and added a test to Antora for it. |
When using asciidoctor.js 2.2.7
I create an (invalid) index.adoc file as show below
= Heading <<https://example.com,Example Link>>
I get the following error:
The latest 3.x asciidoctor.js and asdiidoctor (Ruby) do not fail.
I first noticed this problem when using Antora (which uses asdiidoctor.js 2.x line) in Spring Batch (see the build). It took a lot of effort to track this down. Generally, the failure and error message are very difficult to debug. It would be nice if this were handled in a way that made it easier to solve.
The text was updated successfully, but these errors were encountered: