Zavy86 / WikiDocs

📗 Just a databaseless markdown flat-file wiki engine
https://www.wikidocs.it
MIT License
274 stars 39 forks source link

[Feature Request] Change behaviour of link creator in editor #85

Closed bverkron closed 1 month ago

bverkron commented 8 months ago

Describe the feature

In most apps when you use the feature to create a link when you have text selected (either with a menu button or a keyboard shortcut like CTRL/CMD+K) it will put the cursor in a position where you can paste in the contents of your clipboard which presumably is a URL. This makes creating a link very slick and easy after highlighting the text for the link.

However, in WikiDocs if you select text then hit the link button or CTRL/CMD+K it keeps the original text highlighted and adds https:// into the parenthesis which means you have to manually move the cursor, delete the https, then past in the link. This is a bit cumbersome and has more room for error.

Would be amazing if it would keep the parenthesis empty and just put the cursor between them so you could just hit CTRL/CMD+V to past in the link. Much slicker!

Is your feature request related to a problem? (optional)

No response

Screenshots (optional)

Green bar represents where the cursor would be. image

Extra fields

bverkron commented 8 months ago

Additional thought. Many apps go one step further and if you have a url in your clipboard and highlight the text and simply hit CTRL/CMD+V to paste it will automatically create the link for you with the highlighted text and the url from your clipboard. This is true for GitHub comments / descriptions, Confluence (which I'm migrating to WikiDocs from), Vikunja and a bunch of others. Not sure how easy that is to implement but it would be a great bonus feature on top of the behaviour suggested above.

Zavy86 commented 1 month ago

the editor is provided by EasyMDE https://github.com/Ionaru/easy-markdown-editor, you have to create this pull request to their repository..

@leomoon we have to update to 2.18.0