Testing version:
Version 2.0 (10984)
What were you doing:
writing a doc where I needed to add a bunch of links to various things.
What feature did you use:
I discovered and was trying to use the “highlighted text to make a link” feature -
What happened:
I was wanting to create a link and wondered if, by any luck, Bear 2 might support the cool feature some others apps (ex. Slack) have where you can highlight some text, paste the link, and then the highlighted text is updated to link to what was pasted. And, it worked! I then moved onto to do this for another link and it didn’t work. Confused, I started playing around with different links and I think I discovered the way to reproduce the bug.
- Copy URL to public issue on GitHub.com such as Rails is not Django · Issue #1 · rails/rails · GitHub
- Select text in bear and paste URL.
- Text becomes a link to the URL in markdown.
vs
- Copy URL to private issue on GitHub.com such as GitHub.com/ptoomey3/some-private-repo/issues/1
- Select text in bear and paste URL.
- Text is overwritten with the URL from the clipboard.
vs.
- Copy URL to private issue on GitHub.com such as GitHub.com/ptoomey3/some-private-repo/issues/1
- Select text in bear and hit cmd-k. The text and link are prepopulated with the expected data.
- Hit enter and text becomes a link to the URL in markdown.
What did you expect to happen:
I expect that for all of the above scenarios that the result should be the original text is replaced with markdown, with the original text now linking to the URL that is pasted.
The above behavior seems like it is vaguely aligned with how you treat URLs when pasted in directly into Bear (i.e. no text highlighted first):
- URL from a public repository copy/pasted into Bear results in a markdown link with the text set to the title of the page.
- URL from a private repository copy/pasted into Bear results in the raw URL pasted in.
So, it seems like the “paste URL to highlighted text” is maybe inheriting slightly too much behavior as the normal link pasting. Unlike directly pasting raw links, there is no need to fetch the content and adapt your behavior based on the response since the highlighted text is the text to be used for the link.