Skip to content
Darkmown 2.7

Reactive links

A { … } inside a link or image destination used to be painted once at build time and then went stale. Now it binds: the compiler emits the destination as a small template, and the runtime rebuilds the whole value on every render.

The destination follows the state

Pick a region and watch the link underneath it change. The link is written as ordinary markdown: [Open the EU docs](/docs/{ region }/).

Current region: eu

Open the docs for this region

The href is rebuilt from the literal parts (/docs/ and /) plus the live value, so a value in the middle of a path works exactly like one that fills the whole destination.

One template, every row

A reactive @loop shares ONE row template, so a per-row destination has no single build-time value: it paints empty and the runtime fills each row from its own item.

A bound URL is checked where it lands

The compiler vets URLs an author writes. A bound href carries a value that only exists at runtime, so the scheme is checked again in the browser: javascript:, data: and vbscript: are refused and the attribute is left empty, with control characters stripped first so java	script: cannot sneak through.

The value in state: { danger }

This link's href

Click the second button and inspect the anchor: the whole attribute is emptied rather than half-applied, because the guard runs on the value the runtime assembled, not on the literal parts the author wrote.

Read the docs on destinations that bind