2

I left a link as a comment here. It did not show up as a proper link. Perhaps because the title has has parens, square brackets, and a forward slash.

Note: it does not show it, but I entered https:// in the link.

It would be nice if (in comments) we could just enter the URL and have SO auto-magically display the page title. At least for links to other SO pages.

enter image description here

9
  • 3
    There is a [0] section in the brackets, which causes the markdown parser to be confused what is a link and what is not.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:10
  • 1
    This is not something that can be fixed. Is [How do sizeof(arr) / sizeof(arr[0] the link text, or is [How do sizeof(arr) / sizeof(arr[0]) work?]? We humans know it is the latter, but it is damn hard to make the computer decide this.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:12
  • 2
    I fixed the link for you by escaping the [ and ] characters in the array subscription, by placing a backslash in front of both.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:13
  • @MartijnPieters I thought that might be the case, but saw no mention of it in the docs: stackoverflow.com/editing-help#comment-formatting
    – 001
    Commented Nov 17, 2017 at 16:13
  • 2
    @JohnnyMopp: the editing help is concise and focuses on the usual cases. The help page also points to the full Markdown spec for details, which has a section on escaping with backslashes.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:16
  • 1
    This didn't need deleting, did it? I had an answer ready and everything, which should be helpful to both you and future visitors.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:23
  • 1
    As long as my answer is at 0, you can still re-delete if you so desire.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:23
  • 1
    @MartijnPieters I deleted because of the DVs and the fact the answer was in the docs. But I can leave open. I appreciate the time you took to answer.
    – 001
    Commented Nov 17, 2017 at 16:25
  • 2
    @JohnnyMopp: voting on Meta indicates how many people agree that a bug should be fixed (or is a bug), not necessarily that the question is bad.
    – Martijn Pieters Mod
    Commented Nov 17, 2017 at 16:26

1 Answer 1

7

Your comment doesn't follow the permitted inline link format, because you have more square brackets inside your link text:

[How do sizeof(arr) / sizeof(arr[0]) work?](//stackoverflow.com/q/33523585)
^                               ^ ^       ^

The parser sees [How do sizeof(arr) / sizeof(arr[0], which is not followed by (...), so there is no link there.

You can escape markdown characters by using backslashes:

[How do sizeof(arr) / sizeof(arr\[0\]) work?](//stackoverflow.com/q/33523585)

at which point the link works as expected:

How do sizeof(arr) / sizeof(arr[0]) work?

I fixed your comment.

You might be interested in the SE Comment Link Helper user script, which replaces Stack Exchange links with correctly formatted (escaped where needed) comment links. All you have to do is use a valid SE link in a comment and the helper will fetch the title, escape it, and wrap it in a Markdown link for you. That'll let you avoid having to manually escape special characters in titles.

1

You must log in to answer this question.

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