uiwjs / react-markdown-editor

A markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-markdown-editor
MIT License
338 stars 33 forks source link

Allow uploading image #167

Open ducdoan510 opened 2 years ago

ducdoan510 commented 2 years ago

Hi I am using this great library and may I ask if we can have an image command that allows uploading image from local? Suppose we have a server that can we can upload the image to. The button can then receive a callback that return an image_url to be used in the editor like ![description](image_url).

agustints commented 2 years ago

+1

wenjianzhang commented 2 years ago

+1

jaywcjlove commented 2 years ago

I think you can use events to achieve what you want. https://codesandbox.io/s/react-markdown-editor-forked-ltt49r?file=/src/App.js

<MarkdownEditor
  value="# title"
  onDragover={() => {
    console.log(">>>>3onDragover>>>");
  }}
  onDragenter={() => {
    console.log(">>>>3onDragenter>>>");
  }}
  onChange={(editor, data, value) => {
  }}
/>
jp-programmer1 commented 2 years ago

+1

EmirMaestu commented 2 years ago

+1