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


#1

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.


Autolink restrictions
#2

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


#3

+++ 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.


#4

Thanks for the clarification.