10

This URL isn't getting auto-linked like it should be:

http://en.wikipedia.org/wiki/Entity–attribute–value_model

Moreover, when used inline like so or as a reference like so, it doesn't get auto-linked at all.

The above text uses:

Moreover, when used inline [like so][2] or as a reference [like so][test], it doesn't get auto-linked at all.

[test]: http://en.wikipedia.org/wiki/Entity–attribute–value_model
2
  • <http://en.wikipedia.org/wiki/Entity–attribute–value_model> fails as well. Commented Apr 30, 2014 at 12:54
  • 5
    The work-around is to percent-escape the dashes: http://en.wikipedia.org/wiki/Entity%2Dattribute%2Dvalue_model. Commented Apr 30, 2014 at 12:55

2 Answers 2

8

It works if you change the em-dashes to en-dashes.

http://en.wikipedia.org/wiki/Entity–attribute–value_model

http://en.wikipedia.org/wiki/Entity-attribute-value_model

I don't know if this is a bug in Markdown, or if em-dashes are not supposed to be used in URLs at all. It's hard to find information via Google with all the style guides pontificating about em-dash vs. en-dash. (Apparently it's the "tabs vs. spaces" of typography.)

Update:

According to RFC 3986, em-dashes are not reserved characters and are not in ALPHA / DIGIT / "-" / "." / "_" / "~", so they should be escaped when used in URLs.

2
0

You can create the link: http://en.wikipedia.org/wiki/Entity–attribute–value_model with

[http://en.wikipedia.org/wiki/Entity–attribute–value_model](http://en.wikipedia.org/wiki/Entity–attribute–value_model)

i.e. [Link text in square brackets](https://example.com/url-–with_dashes/)

As outlined in https://spec.commonmark.org/0.29/#links

3
  • I believe the OP knows how to construct links in Markdown. The question was specifically about auto-links; that is, the behavior that occurs when you place a plain URL into Markdown text. Commented Sep 4, 2020 at 14:56
  • Do you know of any other way to make the links work with stackoverflows's current Markdown parser? Commented Sep 4, 2020 at 18:08
  • The other answer shows how -- click edit on that answer to see the Markdown source. Stack Overflow now uses CommonMark, so there are several dozen ways to get links to work. Commented Sep 4, 2020 at 18:47

You must log in to answer this question.

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