portive / wysimark

The Wysiwyg Editor for Markdown: 100% CommonMark + GFM with Uploads and Image Resizing
Other
239 stars 41 forks source link

Text injection at position #73

Open VincenzoManto opened 1 month ago

VincenzoManto commented 1 month ago

Problem Injecting text appears to be impossible as there isn't a clear reference of cursor position neither in the markdown nor in the overall HTML text, thus it's not possible to add text (formatted or not) where the user is positioned programmatically.

Solution Either getting a precise cursor position in the markdown (related to caret position in HTML) or add a method to inject text where the user is positioned.

Use Case Whenever we want to edit the paste behavior or injecting text in position (such as suggestions or autocomplete), it would be important.

Thanks guys for the great job!