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. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
imagePlugin
alongside theimageUploadHandler
hook, 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
handleImagePreview
function 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?
Beta Was this translation helpful? Give feedback.
All reactions