Skip to content

Markdown links: [words](address) becomes the words, linked; after "(/" pages are suggested - #216

Merged
LoopyDev merged 1 commit into
mainfrom
feat/markdown-links
Nov 14, 2026
Merged

LoopyDev merged 1 commit into
mainfrom
feat/markdown-links

Conversation

@LoopyDev

Copy link
Copy Markdown
Owner

The last part of the links work, after the link editor (214) and page mentions (215).

Typing a link the Markdown way

  • [words](address) becomes the words, linked, as the ) is typed. Backspace straight after gives back what was typed.
  • The link is laid over the words, which keep their bold or italic and any mention in them. Only the [ and ](address) are taken away.
  • Addresses are treated as in the link editor: example.com gets https://, and javascript: and the like are left as typed.
  • Addresses with balanced brackets (Wikipedia's …/Mercury_(planet)) work, and a title after the address is allowed and left out. The words end at the first ](, so one in a title doesn't move it.
  • Nothing happens in code (including inline code still being typed), in ![…](…) (the image rule's), after \[, or in [[ (a mention).

While typing

  • [words]( shows a hint under the cursor, "Type an address, or / to link a page". Typing carries on in the page, and Enter is still a new line.
  • [words](/ suggests pages. Spaces are fine while a page matches (/Onboarding g). Picking one links the words to it, leaving nothing else. Escape hides the list, and the keys go back to the page.
  • The typography rules (-- to —, ..., ->, !=) skip an address being typed. They broke links.

Shared with mentions

  • pageSuggestions.js: the page search and the suggestion pop-up.
  • typingContext.js: the line before the cursor (its last 500 characters), unclosed inline code, and a link address being typed.
  • markdownLinks.js only reads the line when there's a ]( in it.

Not fixed: one stray backtick earlier in a line still turns this off for the rest of it. The typography rules have always done the same.

Tests: e2e/markdown-links.spec.ts, 9 tests:

  • conversion, with the hint;
  • undo with Backspace;
  • an unsafe address left as typed;
  • choosing a page;
  • Escape, then typing on;
  • not in code;
  • bold and a mention kept;
  • a page search with a space;
  • brackets in the address, --, a title with ](, and an image.

🤖 Generated with Claude Code

…" pages are suggested

The link is laid over the words (they keep their bold, a mention in them); the "[" and
"](address)" go. Backspace straight after gives back what was typed. "[words](" shows a hint, and
"[words](/" suggests pages, spaces and all. Unsafe addresses, code, images and escaped brackets are
left alone, and the typography rules no longer change an address being typed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LoopyDev
LoopyDev merged commit 6c6e419 into main Nov 14, 2026
7 checks passed
@LoopyDev
LoopyDev deleted the feat/markdown-links branch November 14, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant