Skip to content

Use Buffer.from explicitly when using zlib#16

Merged
kazumatu981 merged 1 commit intokazumatu981:mainfrom
drorgl:main
Jun 21, 2024
Merged

Use Buffer.from explicitly when using zlib#16
kazumatu981 merged 1 commit intokazumatu981:mainfrom
drorgl:main

Conversation

@drorgl
Copy link
Copy Markdown
Contributor

@drorgl drorgl commented Jun 21, 2024

Problem:

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.

@kazumatu981 kazumatu981 merged commit fb4e2d1 into kazumatu981:main Jun 21, 2024
kazumatu981 added a commit that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants