Skip to content

DIALECT-03: Extract a bare wikilink

extractVaultRefs recognizes a bare [[page]] and returns its target.

Builds on: DIALECT-01: Anchor a block, resolve it with byAnchor

A TypeScript program against the library API; inline comments show the resulting values and behavior.

import { extractVaultRefs } from "markdown-contract";
extractVaultRefs("See [[Project Atlas]] for context.");
// → [{ kind: "wikilink", target: "Project Atlas",
// raw: "[[Project Atlas]]" }]
  • extractVaultRefs
  • VaultRef.kind/target/raw (wikilinks.ts)