Search code examples
hyperlinkcommonmark

How do I autolink a nearby file in CommonMark?


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.

How can I create such a link? (Obviously it depends on the renderer and context as to how the link is interpreted.)


Solution

  • An autolink requires an absolute URI, so that won't work. The following code is a bit more verbose, but achieves the desired output:

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

    References: