Skip to content

Commit

Permalink
🐛 resolves #310 fix Kroki on Firefox (#311)
Browse files Browse the repository at this point in the history
* resolves #310 fix Kroki on Firefox

- Upgrade to asciidoctor-kroki v0.3.0
** Catch all exceptions when reading a file (because Firefox does not allow to read file from file:// protocol for security reasons)
** Remove rusha from the bundle (because for whatever reason, it does not work on Firefox)
- Load kroki.js before the renderer.js (order matters on Firefox)

* Upgrade Kroki extension to 0.4.0

* Forcibly remove the kroki-fetch-diagram attribute

Because this feature is not supported in a browser environment.
  • Loading branch information
ggrossetie authored Nov 9, 2019
1 parent 03506de commit af61eb4
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 1,086 deletions.
2 changes: 2 additions & 0 deletions app/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ window.MathJax = {
if (attributesQueryParameters.length > 0) {
Array.prototype.push.apply(attributes, attributesQueryParameters)
}
// Forcibly remove the "kroki-fetch-diagram" attribute because this feature is not supported in a browser environment.
attributes.push('kroki-fetch-diagram!')
const registry = processor.Extensions.create()
if (settings.krokiEnabled) {
AsciidoctorKroki.register(registry, {
Expand Down
Loading

0 comments on commit af61eb4

Please sign in to comment.