djot icon indicating copy to clipboard operation
djot copied to clipboard

`[text][]` is shorthand for `[text][text]` – should `[text]()` mean `[text](text)`?

Open tmke8 opened this issue 2 years ago • 3 comments

I could see this being useful for relative links:

You can find the PDF here: [paper.pdf]().

rendered as

<p>You can find the PDF here: <a href="paper.pdf">paper.pdf</a>.</p>

(spaces should be turned into %20 in href=)

Also, personal wikis could use this syntax to link to other files: (though this doesn't take into account file name extensions...)

Honey is produced by [bees]().

Note that the autolink syntax doesn't work for this:

<paper.pdf>

gets rendered as

<p>&lt;paper.pdf&gt;</p>

tmke8 avatar Feb 14 '23 23:02 tmke8

jgm/gitit has long used [bees]() as a syntax for wikilinks.

jgm avatar Feb 15 '23 01:02 jgm

See also #26

uvtc avatar Feb 17 '23 03:02 uvtc

I think that it is probably wisest to leave the handling of empty links to renderers/filters since applications may differ as to what is the most sensible use for them: gitit uses them for wikilinks, so that [Link Text]() is short for [Link Text](some/path/link-text.html), my Pandoc filter uses them for local links so that [Link Text]() is short for [Link Text](#link-text) (and [Link Text](path#prefix#-suffix) is short for [Link Text](path#prefixlink-textsuffix) where each of path/prefix/suffix is optional — especially useful for [heading about thing](##s)! — and [Link Text](some/path.*) is short for [Link Text](some/path.<ext>) where the value of <ext> is declared in the metadata) and there may be other uses still.

bpj avatar Feb 17 '23 07:02 bpj