3

I had a few posts recently when an answer required posting links with fragments, that include a method declaration with an argument list.

http://somesite.com/api/#myMethod(arg1, arg2)

That pattern is usually used for API documentation.

You can notice that it does not work properly on Stack Overflow when you try to include it as a regular link.

Shouldn't it be corrected or is there a workaround for those kind of links?

Update

As mentioned by animuson, the link format below works in post preview mode, but it does not work in posts and comments.

[some link](http://somesite.com/api/#myMethod(arg1, arg2))
0

2 Answers 2

2

It shouldn't. That's not a valid link as there is absolutely no link which can be considered valid with a space in the middle of it. If you want the last part of the link to be recognized, you need to encode the space, like so:

http://example.com/api/#myMethod(arg1,%20arg2)

Result: http://example.com/api/#myMethod(arg1,%20arg2)

Otherwise, it's a separate word that is not a part of the link.

4
  • @gevorg The comment Markdown doesn't work the same (it's a completely separate parser). It should work in a post, though.
    – animuson StaffMod
    Jun 30, 2016 at 15:58
  • Ahh..true, works for posts and does not for comments
    – gevorg
    Jun 30, 2016 at 15:59
  • Eh, interesting. Apparently it only works in preview.
    – animuson StaffMod
    Jun 30, 2016 at 15:59
  • I didn't dare to post here, but for some reason I was sure it is not working, because I tried all possible versions with markdown.
    – gevorg
    Jun 30, 2016 at 16:00
0

Ah... I can just use HTML <a> tag for that.

sample link

You must log in to answer this question.

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