Markdown copy, paste, and per-page Markdown export endpoint #30

Closed
opened 2026-07-04 14:52:12 +02:00 by fable-5 · 1 comment
Collaborator

Context

Markdown is the primary exchange format (vision); copy/paste must produce/consume it.

Scope

Wire docToMarkdown/markdownToDoc (#24) into the editor: copying selected content puts Markdown alongside HTML on the clipboard; pasting Markdown text converts it to rich nodes (heuristic: parse when the text looks like Markdown, otherwise plain). Add GET /pages/:id/export/markdown (Content-Disposition download) and a 'copy page as Markdown' action in the page menu.

Acceptance criteria

  • copying a heading+list selection and pasting into a plain editor yields Markdown
  • pasting a Markdown document into an empty page recreates structure (fixture e2e)
  • export endpoint downloads <slug>.md matching the fixture expectation
  • plain-text paste is not mangled (heuristic false-positive test)

Technical notes

  • ADR 0004/0009 (Markdown path is in-process, not pandoc).

Dependencies

Depends on #24, #25.

Size: ~1 day


Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add de and en), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.

## Context Markdown is the primary exchange format (vision); copy/paste must produce/consume it. ## Scope Wire `docToMarkdown`/`markdownToDoc` (#24) into the editor: copying selected content puts Markdown alongside HTML on the clipboard; pasting Markdown text converts it to rich nodes (heuristic: parse when the text looks like Markdown, otherwise plain). Add `GET /pages/:id/export/markdown` (Content-Disposition download) and a 'copy page as Markdown' action in the page menu. ## Acceptance criteria - [ ] copying a heading+list selection and pasting into a plain editor yields Markdown - [ ] pasting a Markdown document into an empty page recreates structure (fixture e2e) - [ ] export endpoint downloads `<slug>.md` matching the fixture expectation - [ ] plain-text paste is not mangled (heuristic false-positive test) ## Technical notes - ADR 0004/0009 (Markdown path is in-process, not pandoc). ## Dependencies Depends on #24, #25. **Size**: ~1 day --- *Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add `de` **and** `en`), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.*
fable-5 added this to the M2 — Ponds & pages, single-user editing milestone 2026-07-04 14:52:12 +02:00
fable-5 added the
backend
frontend
labels 2026-07-04 14:52:12 +02:00
Collaborator

Implemented in c9011cb and closed via Closes #30. Pipeline verification for that commit:

  • CI / Lint, typecheck, test — success
  • CI / Auth e2e pack — success
  • CD / Build and push images — success
  • CD / Deploy to Test — success
  • CD / Smoke tests against Test — success
  • CD / Promote to Int — success

Acceptance criteria covered by apps/web/e2e/markdown.spec.ts (run locally against the dev stack) and apps/api/src/pages/pages.e2e.db.test.ts (in CI): copying a heading+list selection yields Markdown on the clipboard, pasting a Markdown document recreates structure, plain-text paste is not mangled (heuristic false-positive unit tests in markdown-clipboard.test.ts), and the export endpoint downloads <slug>.md matching the fixture.

Implemented in c9011cb and closed via `Closes #30`. Pipeline verification for that commit: - CI / Lint, typecheck, test — success - CI / Auth e2e pack — success - CD / Build and push images — success - CD / Deploy to Test — success - CD / Smoke tests against Test — success - CD / Promote to Int — success Acceptance criteria covered by `apps/web/e2e/markdown.spec.ts` (run locally against the dev stack) and `apps/api/src/pages/pages.e2e.db.test.ts` (in CI): copying a heading+list selection yields Markdown on the clipboard, pasting a Markdown document recreates structure, plain-text paste is not mangled (heuristic false-positive unit tests in `markdown-clipboard.test.ts`), and the export endpoint downloads `<slug>.md` matching the fixture.
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stwaidele/dorfteich#30
No description provided.