Using markdown-it-kroki inside an obsidian marp plugin fails to compress the diagram properly and produces 400 error on kroki
Desired Result
Diagrams show up properly on obsidian marp plugin
Cause:
To compile obsidian plugins for use in both mobile and desktop, the plugins needs to be packed for web only.
The packed zlib-browserify is using pako which does not support compressing strings, the proposed change solves that issue by adding Buffer.from.
Further information:
the default browserify buffer module does not support base64url, so I'm using an alternative from feross (specifically pr 314)
I didn't want to add extra noise by adding more changes to this plugin by modifying the base64url as well.
Problem:
Using
markdown-it-kroki
inside an obsidian marp plugin fails to compress the diagram properly and produces 400 error on krokiDesired Result
Diagrams show up properly on obsidian marp plugin
Cause:
To compile obsidian plugins for use in both mobile and desktop, the plugins needs to be packed for web only. The packed
zlib-browserify
is using pako which does not support compressing strings, the proposed change solves that issue by adding Buffer.from.Further information:
the default browserify buffer module does not support base64url, so I'm using an alternative from feross (specifically pr 314) I didn't want to add extra noise by adding more changes to this plugin by modifying the base64url as well.