Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Buffer.from explicitly when using zlib #16

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

drorgl
Copy link
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