How should I create a link to a nearby file? [answered]

I am creating a README.md file and in it I want to link to COPYING.md in the same directory. I tried the following markup, but the link is not rendered:

See <COPYING.md> for details.

So I did this instead and it worked:

See [COPYING.md](COPYING.md) for details.

Should the first option have worked, according to the CommonMark spec? (i.e. should I report it as a bug to the maintainer)

If this isn’t in the spec, would it be a candidate for a suggestion? The first options is less verbose and more readable in regular unrendered text.

Autolinks (<....>) require scheme specification (e.g. <http://....>), and for good reason as there might be otherwise problems e.g. with <sometag>xxxx</sometag>.

2 Likes

+++ David Seaward [May 29 17 11:47 ]:

Should the first option have worked, according to the CommonMark spec?
(i.e. should I report it as a bug to the maintainer)

No. An absolute URI is required for an autolink:
http://spec.commonmark.org/0.27/#uri-autolink

If this isn’t in the spec, would it be a candidate for a suggestion?
The first options is less verbose and more readable in regular
unrendered text.

The problem is that raw HTML tags are allowed in Markdown,
so one would need some heuristic to distinguish them from
autolinks. Requiring an absolute URI does that, and is
also consistent with John Gruber’s Markdown syntax
description and with standard practice in Markdown
implementations.

2 Likes

Thanks for the clarification.

I was wondering over this as well. [COPYING.md](COPYING.md) seems unnecessarily redundant.

I understand that autolinks cannot do the jobs.

Would it alternatively be reasonable to allow for an empty link text [](COPYING.md) and in that case use the link destination also as the link text?