Skip to content

feat: improve markdown link handling#845

Merged
paulrobertlloyd merged 1 commit into
getindiekit:mainfrom
eclecticpassions:feat-auto-md-links
Jul 4, 2026
Merged

feat: improve markdown link handling#845
paulrobertlloyd merged 1 commit into
getindiekit:mainfrom
eclecticpassions:feat-auto-md-links

Conversation

@eclecticpassions

@eclecticpassions eclecticpassions commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

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 the textarea/index.js file. I tested it locally and it seems to be working! But I'd appreciate your feedback to see if it's worth adding to Indiekit main or 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 the https:// 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

@paulrobertlloyd paulrobertlloyd force-pushed the main branch 2 times, most recently from 421a288 to 84a8e9a Compare May 10, 2026 22:30
@eclecticpassions

Copy link
Copy Markdown
Contributor Author

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!

@paulrobertlloyd paulrobertlloyd force-pushed the main branch 3 times, most recently from bfabfcc to fe56b06 Compare June 28, 2026 16:33
@paulrobertlloyd

Copy link
Copy Markdown
Collaborator

Am slowly getting back to being able to work on this project; will take a look at this PR soon.

@eclecticpassions

Copy link
Copy Markdown
Contributor Author

Thanks @paulrobertlloyd for checking it! Very happy to see you. Appreciate it. ;)

@paulrobertlloyd paulrobertlloyd force-pushed the feat-auto-md-links branch 2 times, most recently from 0150f61 to 92aa7a3 Compare July 4, 2026 13:26
- 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/).
@paulrobertlloyd

Copy link
Copy Markdown
Collaborator

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 []() (with the cursor placed within the brackets). If you have text selected, then the selected text gets updated ([selected text]()).

I have also updated the code to follow linting rules, and call the already provided editor.codemirror reference instead of querying .CodeMirror.

@paulrobertlloyd paulrobertlloyd merged commit 605fd1f into getindiekit:main Jul 4, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants