This limitation has me in a tizzy today.
Compress data with deflate algorithm using a compression level of 9 (best compression). pako
is available as a global variable.
Trying to get a rendered mermaid diagram from kroki.io. Turns out deflate is a limitation of the hosted version.
- Encode the diagram as UTF8 in a
Uint8Array
(using thetextEncode
function declared above) - Compress data with deflate algorithm using a compression level of 9 (best compression).
pako
is available as a global variable. - Encode to Base64 using
btoa
global function - Replace
+
and/
characters to make it “URL safe”
Thanks.