I'm mostly active in the Java forums these days, and often I find the desire to link to a method in the Java API, but the markdown syntax doesn't seem to handle the URL format quite well.

Here's an example of a URL that I was recently trying to link to:


I guess you can easily notice that it breaks a valid URL.

Edited 3 Years Ago by mvmalderen

I've reopened this question because of another issue that I'm facing.

In this post the URL doesn't get rendered correctly. I checked using a different browser with cleared cache.

I wrote the text "Math.pow", selected it, clicked the Link button, and pasted there the copied URL:
http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#pow(double, double).

[Math.pow](http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#pow(double, double))

Also it feels unpleasant that a URL gets URLified when marked as inline code.

I use Pale Moon 15.4.1-x64 and Chrome 24.0.1312.57 m.

Edited 3 Years Ago by mvmalderen

The issue is that your link cannot have a space within it.

Convert spaces to %20 as so:


It is by design that URLs get URLified within code. It's a common occurrence that code includes a comment with a link to its author, etc. Because it doesn't make sense to allow markup within code, since code should be literal, I chose to auto-linkify all links within code.

Convert spaces to %20 as so

That fixes it. Thank you :)

It is by design that URLs get URLified within code.

However this post first inline code box doesn't URLify the whole link. As you can see the '(T...)' part is not URLified. How is that done then?
Also that makes me wonder why a valid URL such as
doesn't get URLified as a whole automatically?

Edited 3 Years Ago by mvmalderen

The problem is with closing parentheses. Just escape the closing parentheses by leading it with backslash character and it should work out fine. For e.g.

http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#asList(T...) [without backslash]


http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#asList(T...) [with backslash before the )]

EDIT: It seems like there is a bug in the MD renderer. The preview shows the complete URLfied URL for the second case but after a submit it disappears.

Edited 3 Years Ago by ~s.o.s~

It's possible there is a bug in the live-preview. :( Will check into that ...

The auto-linkify feature will automatically quit at the sight of parentheses (Because it makes sense for people to naturally type naked links in parentheses like this: http://www.daniweb.com).

However, the explicity linkify feature will linkify everything (including parens) up until the first non-URL compliant character that it sees (such as a space).

This question has already been answered. Start a new discussion instead.