pasting a link surrounds text in markdown link - #363
Merged
HermanMartinus merged 2 commits intoAug 11, 2025
Conversation
Talor-A
marked this pull request as ready for review
August 5, 2025 22:43
Author
|
btw, I read |
Owner
|
I just gave this a spin, and it wasn't even on my radar as a feature suggestion but feels natural and I can't find any fault with it. I appreciate the consistency with other paste commands and their respective fallbacks 👌 Will merge. Thanks for the contribution. |
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 just started writing my first post with bearblog, and noticed a small behavior issue that bugged me: I'm used to being able to select some text and then paste a URL over it in most markdown editors. I implemented a small function to do so in bearblog.
I used document.execcomand where supported as this preserves the input history buffer, so
cmd+zstill works. there's a fallback if the API isn't supported by the user's browser.the
isURLfunction is as dead-simple as possible. it could possibly incorporate thenew URL()constructor provided by the browser to more reliably identify links, but simpler felt better here.