feat: improve markdown link handling#845
Open
eclecticpassions wants to merge 2 commits into
Open
Conversation
- 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/).
421a288 to
84a8e9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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