Paste URL to highlighted text to make a link doesn't work when not publicly accessible

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.

  1. Copy URL to public issue on GitHub.com such as Rails is not Django · Issue #1 · rails/rails · GitHub
  2. Select text in bear and paste URL.
  3. Text becomes a link to the URL in markdown.

vs

  1. Copy URL to private issue on GitHub.com such as GitHub.com/ptoomey3/some-private-repo/issues/1
  2. Select text in bear and paste URL.
  3. Text is overwritten with the URL from the clipboard.

vs.

  1. Copy URL to private issue on GitHub.com such as GitHub.com/ptoomey3/some-private-repo/issues/1
  2. Select text in bear and hit cmd-k. The text and link are prepopulated with the expected data.
  3. 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):

  1. URL from a public repository copy/pasted into Bear results in a markdown link with the text set to the title of the page.
  2. 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.

1 Like

Apologies…I just noticed I had somehow not entered the correct title. I’ve updated the title of the bug to match the content above.

Thanks for reporting this issue. I can confirm this was not expected

And will behave as 1. with the next update.

That is great…thanks!

I noticed that this functionality doesn’t work if I cut/pate a link from within bear itself. For example, if I have a url in bear such as ptoomey3 (Patrick Toomey) · GitHub and I copy/cut that URL and paste it onto some highlighted text, it pastes over the text instead of creating a link. This is kinda funny since it seems unique to URLs cut/copied from within Bear itself. For example, I copy/pasted the link I just typed into this bug report text box (ptoomey3 (Patrick Toomey) · GitHub) when writing up this reply and it worked fine when pasted onto highlighted text within bear). Should I open a new bug for that?

1 Like

Yes, this case was not considered, good catch. We’ll provide a fix with the next update.

2 Likes

I got another one :grinning:. If you do this “paste over text” flow text in a table it pastes over the text instead of making the highlighted text a link

1 Like