feat: improve markdown link handling#845
Conversation
421a288 to
84a8e9a
Compare
|
Hi @paulrobertlloyd, is there anything I can do to help get this reviewed or merged if deemed suitable, as it's been a while? If it's not suitable, I will go learn how to maintain my own separate version so I can use the Markdown editing features. Thanks! |
bfabfcc to
fe56b06
Compare
|
Am slowly getting back to being able to work on this project; will take a look at this PR soon. |
|
Thanks @paulrobertlloyd for checking it! Very happy to see you. Appreciate it. ;) |
0150f61 to
92aa7a3
Compare
- Improve how Markdown links are handled when the "link" button is pressed by removing the placeholder `https://` inside the `()`. Now when the button is pressed, the cursor jumps to the empty `()` after the `[link text]` and ctrl+v will paste the link in. - Added new feature: auto paste links and have it be converted to Markdown link syntax automatically without using the link button in the editor toolbar (like in GitHub — https://github.blog/changelog/2022-02-02-paste-links-directly-in-markdown/).
92aa7a3 to
92e2537
Compare
|
Thanks so much for this @eclecticpassions, these are great quality of life improvements! I spotted (and fixed) one issue: if you click the link icon with no text selected, you wouldn’t get any output. I have updated the behaviour so that clicking the link button with no text selected returns I have also updated the code to follow linting rules, and call the already provided |
Hi,
I wanted these two features for a long time as I'm very used to pasting links directly into selected text in VS Codium and Obsidian.
With some help from
qwen2.5-coder, I figured how to add the two features into thetextarea/index.jsfile. I tested it locally and it seems to be working! But I'd appreciate your feedback to see if it's worth adding to Indiekitmainor if there's any errors/improvements.My two additions:
Improve how Markdown links are handled when the "link" button is pressed by removing the placeholder
https://inside the(). Because, then I have to select thehttps://and then paste the link from my clipboard. The extra step is a bit cumbersome (to me). Now, when the button is pressed, the cursor jumps to an empty()after the[link text]and ctrl+v will paste the link in, making it quicker and less fiddly.Added new feature of generating Markdown links automatically a link is pasted into highlighted text. This means it doesn't require using the mouse to press the link button in the editor toolbar (like in GitHub).
Thanks @paulrobertlloyd!
Edit: correct wrong link to GitHub example