3

On all Stack Exchange websites, using square brackets in a hyperlink like in the following Markdown code is correctly translated into HTML in questions and answers, but not in comments:

[[class.access]](http://eel.is/c++draft/class.access).

9
  • Related: Escape square brackets in comment links. The linked post suggests to use \[ and \], for example., [\[class.access\]](http://eel.is/c++draft/class.access) gives [class.access].
    – Martin
    Feb 14 '20 at 13:31
  • @Martin Thanks for the link. But comments and questions & answers should behave the same way.
    – Maggyero
    Feb 14 '20 at 13:40
  • Meh, why use square brackets as link text, there is no use in that. Just don't double them up.
    – Luuklag
    Feb 14 '20 at 13:43
  • Fair enough! The two post can probably be considered different - the other is asking how to use links where the title contains square brackets the way MarkDown currently works in the comments - while your post suggests that instead of using a workaround this should be considered a bug. Still, I think that the link to the workaround might be useful for users reading your question. (I hope I remember this correctly - IIRC you need to add \[ and \] also for such links in chat, not only comments.)
    – Martin
    Feb 14 '20 at 13:44
  • @Luuklag The C++ standard should be quoted like that, it is the name of each paragraph (just look at it).
    – Maggyero
    Feb 14 '20 at 13:45
  • [class.access] Or you just put the extra brackets outside of the hyperlink, easy fix.
    – Luuklag
    Feb 14 '20 at 13:47
  • @Martin Yes the workaround is useful that is why I thanked you. I don’t know which way is the best (requiring the escape character or not) but comments and questions & answers should at least behave consistently.
    – Maggyero
    Feb 14 '20 at 13:49
  • 1
    @Luuklag I am not looking for a workaround, I am looking for consistency in user experience. Comments should behave the same as questions & answers on this matter.
    – Maggyero
    Feb 14 '20 at 13:51
  • Well then I think your in for a pain. IMHO comments use the most basic form of Markup, so that would mean that we should make posts consisted with how markup is handled in comments. So having to escape special characters in posts as well.
    – Luuklag
    Feb 14 '20 at 15:08

You must log in to answer this question.

Browse other questions tagged .