switch to browser base64 methods#26
Conversation
|
The issue described in #8 was reproducible on my iPhone 12 Pro (no diagrams were rendered). After applying this patch, all diagrams from kroki-test.md render correctly, except that the Diagrams.net type is still not rendered. Thank you, @BwayCer — your changeset is both essential and very helpful for me. |
|
Thanks @BwayCer — taken in 1.3.0 (#29, https://github.com/gregzuro/obsidian-kroki/releases/tag/1.3.0). The implementation is slightly hardened from this PR: let binary = "";
const chunkSize = 0x8000;
for (let i = 0; i < compressed.length; i += chunkSize) {
binary += String.fromCharCode(...Array.from(compressed.subarray(i, i + chunkSize)));
}
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_");Same effect, won't choke on big diagrams. Closing — your fix is in the release. |
Use native browser APIs to solve this issue.