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

Image preview handler #411

Merged
merged 4 commits into from
Mar 12, 2022
Merged

Image preview handler #411

merged 4 commits into from
Mar 12, 2022

Conversation

diego-gw
Copy link

@diego-gw diego-gw commented Mar 2, 2022

Added the option to for the user to provide a handling function
imagesPreviewHandler(parsedUrl: string) => string
when previewing images in the editor allowing dynamic previewing of images directly in the frontend.

Diego Garcia Weber added 2 commits March 1, 2022 17:15
Copy link
Owner

@Ionaru Ionaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide an example of how this would be used? I'm confused about what the exact input/output of this function should be.

types/easymde.d.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@diego-gw
Copy link
Author

diego-gw commented Mar 7, 2022

Can you provide an example of how this would be used? I'm confused about what the exact input/output of this function should be.

When copy-pasting images to the editor, I can use the clipboard event in the frontend to extract the image file and name. Then I can refer to the image in the markdown and use the handling function to preview it immediately. Images can be copy-pasted to the editor in the frontend only and uploaded all at once on save.

Sorry for the late reply.

@Ionaru Ionaru merged commit 76fda35 into Ionaru:master Mar 12, 2022
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.

None yet

2 participants