-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
asciidoctor-kroki silently skip some plantuml diagrams rendering #421
Comments
Could you please provide a source file that reproduces this issue? |
Here is a fragment of asciidoctor document with problem diagram:
Here is a source plantuml diagram file:
The problem root is
The plantuml 2023.9.1 crashes with java.lang.IllegalArgumentError and asciidoctor-kroki ignores this showing successful build with |
Thanks! |
But dir structure doesn't matter, I think. The error triggering instruction is |
OK, so the following should be enough:
|
I get the following error: <p>GET <a href="https://kroki.io/plantuml/svg/eNpzL8ovLcjMS9cIdvHWUVACkkqaCtUKtVwAaXkHMw==" class="bare">https://kroki.io/plantuml/svg/eNpzL8ovLcjMS9cIdvHWUVACkkqaCtUKtVwAaXkHMw==</a> - server returns an empty response or a 404 status code - plantuml::/path/to/diag.puml[]</p> I also got a message in the console:
test.js const asciidoctor = require('@asciidoctor/core')()
const kroki = require('asciidoctor-kroki')
const registry = asciidoctor.Extensions.create()
kroki.register(registry)
const html = asciidoctor.convert('plantuml::diag.puml[]', {
to_file: false,
standalone: true,
safe: 'safe',
extension_registry: registry,
attributes: {
'kroki-fetch-diagram': true,
'kroki-default-options': 'inline',
'imagesdir': 'build/images',
'allow-uri-read': 'true',
'data-uri': 'true',
'icons': 'font',
'webfonts!': '',
}
})
console.log(html) diag.puml
Complete output
|
Thanks. Could you suggest how I can enable verbose (debug) logging/tracing the kroki requests/responses within asciidoctor-kroki.js? I'am not JavaScript developer, but I think, I can make some code navigation and updates in JS code. |
I've spent some time to debug this issue and found something. I have root build.js file with list of documents like this:
the broken images are always in second file. I found, if I init extensions instance for every execution - the problem doesn't appear anymore:
|
Someone created a similar issue in Asciidoctor.js: asciidoctor/asciidoctor.js#1709 @mojavelinux Does that ring a bell? We are probably doing something wrong (i.e., our assumptions were wrong) but it seems that we need to manually (re)activate extension registry if the registry is used multiple times. I vaguely remember a bug about extensions and activation but I cannot fully remember. |
Might be related: asciidoctor/asciidoctor@28c6907 |
That's correct. This should have been addressed in 2.0.18. However, there's no guarantee it covers every use case. A registry is not really designed to be reused. Ideally, it should be created per conversion. |
asciidoctor-kroki v 0.17, asciidoctor.js 3.0.2.
Building single HTML file using node.js.
Some PlantUML diagrams does not rendered without any visible error from asciidoctor-kroki or Node.JS.
A the result, I've got a package of HTML documents from build procedure, where some documents has broken diagrams.
The asciidoctor-kroki options are:
The fragment of resulting HTML document source is:
See here, the asciidoctor left original plantuml block source instead of HTML block.
The document contains about 15 diagrams, most of them build successfully, but some has been skipped like this.
I've thorougly inspected all the diagrams in the document and I found PlantUML internal error (java.lang.IllegalArgument wzception) in some of them after PlantUML upgrade to version 1.2023.9.
I know how fix these diagrams, but there is a problem with asciidoctor-kroki: the asciidoctor-kroki implementation suppress errors from PlantUML, shows successful build with broken documents.
There is a problem for large documentation project with hundreds of documents.
I'm not JavaScript developer, but I can try to help you with debug and fix that if you tell me some suggestions where to find the cause in asciidoctor-kroki source.
The text was updated successfully, but these errors were encountered: