When I link to a comment within the same question, the link doesn't bring me to the comment itself unless I open it in a new tab/window. Can we fix that?
This will be fixed in the next build, rev > 2013.5.14.1013.
I took Tim Stone's advice and used the
hashchange event - it really cleaned the code up (thanks, Tim).
#comment341467_126169, but there is no element on the page with that ID. So when you click it, the browser appends the comment to the URL and searches for it, sees it doesn't exist, and does nothing.
As for the redirection issue mentioned (I think, I kind of skimmed the comments): When you embed a URL to a comment as a link inside another comment or post, that URL becomes hard-coded (it doesn't automatically change to correct the URL). So, if you start with the title
Comment links within the same question, but change the title to something like
Comment links within the same question redirect after someone posted a link to a comment in that question, the entire URL changes.
Since the URLs do not match before the
#comment part, the browser sees the two as entirely different URLs, so it will reload the page.
With that in mind, throwing
StackExchange.questions.init() would solve the problem (Except in IE7 and other ancient browsers, but meh). It would also allow the
to be removed from the current comment link HTML, since it makes me sad-face.
There's also a larger problem of getting a comment link from an answer if you accessed the answer by a direct URL, since if the question slug changes in the interim you get redirected to the new answer URL, instead of the comment.
That becomes even more problematic if I were to instead get a comment link from the question in such a case, since you don't end up at the right post (you should end up on this comment). A similar scenario could probably come about on questions with more than one page of answers, as well, although that's pretty edge-case.
Making the comment link URLs fully qualified would alleviate some of those issues, though it might cause unnecessary redirects as a result. This happens anyway when you link to answers within the same post currently, so perhaps that's not a huge issue.
Keep in mind that comment linking works only on a "best-effort" basis, so it's understandable if this isn't something worth addressing.