I’m trying to implement image upload in CodeMirror using widgets containing a file input.
I got the basics working, so far so good:
Insert widget using LineWidget
File upload on file input change
Replace the widget with markdown image ![name](url)
Now I’d like the widgets to behave like “inline block” content, moving down on newline and removed on backspace the an empty line below. But a LineWidget is bound to the line, so it sticks to the line (as expected):
Thanks, I’ll give it another try. Do you by any chance have an example of setBookmark?
I’ve tried fiddling with it but I can’t get it to feel “inline”. For example I can’t seem to remove it using backspace/delete (only when using in combination with alt/cmd). Is this by design?