4

I'd like to add some brief links like this:

link text (i.e. [link text](#anchor))

So that they are converted to this:

<a href="#anchor">link text</a>

But so far I've noticed that it's impossible in comments.

For example, if I'd like to add a comment like this:

Please compare your answer to [this answer posted earlier by Jon](#125135235),
they are almost identical.

or

Per your comment, I've added my answer [here](#543543534).

how can I do this without absolute links?

5
  • 1
    Not sure I understand, what's wrong with the "Share" link under each answer? Commented May 27, 2016 at 3:12
  • I wanted to get a link that does not need a page reload, and is relative, and is short.
    – mbdevpl
    Commented May 27, 2016 at 3:57
  • 1
    Oooooh, without absolute links! Time for a coffee... Commented May 27, 2016 at 3:59
  • You are right... coffee sounds good :)
    – mbdevpl
    Commented May 27, 2016 at 4:03
  • meta.stackexchange.com/questions/37894/… is slightly different but what I was looking for - so to help others find a suggestion about anchor links that is not limited to answers. Commented Jan 10, 2021 at 19:46

2 Answers 2

6

Those links would break in the (admittedly unlikely) event that answers spanned multiple pages.

Instead, use /a/543543534 for a short link: blah blah blah.

2
  • 1
    Hmmm... so it seems there is no way of getting a reliable short address that does not need a page reload?
    – mbdevpl
    Commented May 27, 2016 at 4:01
  • 1
    Not reliable, no.
    – Shog9 Mod
    Commented May 27, 2016 at 4:05
2

As explained by Shog9 there seems to be no way of getting a 100% reliable link that is short, relative, and does not require a page reload.

Having this (i.e. https://meta.stackoverflow.com/questions/323893/markdown-relative-anchor-links-do-not-work) question and it's accepted answer as an example, below are possible solutions.

  • If you go for ?% reliable, relative, and does not require a page reload:

    [link text](/questions/323893/markdown-relative-anchor-links-do-not-work#323894)
    

    Example: see answer by Shog9.

  • If you go for 100% reliable, short and relative, then it requires a page reload:

    [link text](/a/323894)
    

    Example: see answer by Shog9.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .