Repository navigation
Replies: 1 comment 2 replies
|
Hey there, Let me see if I understand correctly: you keep the actual source (as in, the path) in the markdown, but you want to use a base64 string as the image src only in edit mode? How do you determine the base64 content - is it a derivative of the path? It's relatively easy to plug such sort of a hook within the existing lifecycle of the plugin. I'm not sure how adventurous you feel about it, happy to provide some guidance. I can also get to doing that, but it will likely take me a few days. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Firstly, thanks for the great work on the editor!
We're currently using React-Markdown integrated with React-Markdown-Editor-Lite, but are in the process of moving to mdx-editor. I'm using the
imagePluginalongside theimageUploadHandlerhook, which is working great. We did have one other requirement though, which is a hook that can handle image previews. For context, we're using a git repository as the backend for our markdown and assets, so need a way to fetch images programmatically.To help visualise, here's roughly what this looks like currently using react-markdown components:
The
handleImagePreviewfunction then fetches the image from our repository as base64, and returns an updated React node:I appeciate this is a bit of a niche requirement, but do you know of a simple way to extend the existing image plugin to make this possible? Or, is it easier to create a new plugin based on the existing one?
All reactions