Links in quotes sometimes not working

Lately, I’ve been noticing that some hyperlinks will not work when they’re opened in the same tab.

The only example I can link at the moment is this post. <-Click here to see the post in question.

If you Ctrl+click the link, it will open the intended YouTube video without issue. However, if you simply click on it, the link will mess up and take you to a blank, white screen.

I made a bug thread on Hummingbird, and HB contributor wopian said…

So, I am doing just that. I will try to check back here in case you guys need any more input from me. If I’m slow to reply, I can be easily reached on Hummingbird (username Jim), or at the E-mail I registered here with.

Thanks!

##Here’s the bug in action in the Discourse TryIt


Ok. So a user creates a post or comment that contains a link, whether it be in plain text, markdown or HTML hyperlinks (https://google.com, [Google](https://google.com) or <a href="//google.com">)

Another user then quotes part of this post which contains the link. Clicking on this link takes it through the click redirect and to the intended page (google.com) and also increases the click count on the original post.

Editing or deleting that post keeps the link in the quoted message, but upon clicking it and getting redirected to the click redirection page it hangs, as I presume it can’t find the link to increment.

The only way to currently avoid this is to use the right-click context menu Open link in…. Both left-click and middle-click encounter this issue.

I wonder if this might be related to what I’ve noticed with links in deleted posts.

*I have “open in new tab” selected in my Preferences

If I click on a link in a deleted post I get a blank page with the address bar showing similar to
http://community.sitepoint.com/clicks/track?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSDokuMLmWCw&post_id=849278&topic_id=111370

But if I right-click open in new tab the link loads the page in OK

2 Likes

I’m very ignorant of how this kind of stuff works, but could this bug be caused by the fact that I deliberately misquoted ThatSam?

The words I quoted from his post weren’t originally a hyperlink. I changed what he said and added the link as a joke.

Oooh, that’s probably the bug - it doesn’t find the link in the post (or doesn’t find the post!) and errors out instead of passing you on.

Submitted a fix :confetti_ball:

https://github.com/discourse/discourse/pull/3142

5 Likes