Problem
L<> currently accepts only URL and display text. No way to specify per-link metadata like "open in new tab" or "this is a download".
=config L<> sets defaults for entire document, but often need different behavior for specific links.
Solution
Extend L<> syntax to accept attributes after URL:
Boundary: first space + colon starts config section. URLs don't contain this sequence, so parsing is unambiguous.
Syntax
L<API docs|https://api.example.com :new>
L<Download SDK|file:sdk.tar.gz :download>
L<French docs|doc:Guide :lang<fr> :title('Version française')>
Attributes
Four core attributes:
| Attr |
Type |
What it does |
:new |
bool |
open in new context (tab/window/pane) |
:title |
string |
tooltip / advisory text |
:lang |
string |
language of target |
:download |
bool/string |
mark as download; string = filename |
Precedence
Inline overrides =config:
=config L<> :new
L<external|https://x.com> # gets :new from config
L<internal|doc:Local :!new> # override: no new context
Edge cases
File paths with spaces must be quoted:
L<file:'my doc.pdf' :download> # correct
L<file:my doc.pdf :download> # wrong — parser error
URL path params (:id) distinguished by no preceding space:
L<https://api.com/users/:id :new>
^^^^ ^^^^
URL attr
Notes
No breaking changes . Existing L<> without attributes works exactly as before.
Same syntax applies to W<> contextual backlinks.
Problem
L<>currently accepts only URL and display text. No way to specify per-link metadata like "open in new tab" or "this is a download".=config L<>sets defaults for entire document, but often need different behavior for specific links.Solution
Extend
L<>syntax to accept attributes after URL:Boundary: first
space + colonstarts config section. URLs don't contain this sequence, so parsing is unambiguous.Syntax
Attributes
Four core attributes:
:new:title:lang:downloadPrecedence
Inline overrides
=config:Edge cases
File paths with spaces must be quoted:
URL path params (
:id) distinguished by no preceding space:Notes
No breaking changes . Existing
L<>without attributes works exactly as before.Same syntax applies to
W<>contextual backlinks.