feat: Markdown editor with toolbar limited to rendered features #74

Merged
Sebi merged 1 commits from feat/markdown-editor into main 2026-11-22 10:29:13 +00:00
Owner
  • MarkdownEditor component (templ) + behavior in app.js: toolbar, Write/Preview tabs, Ctrl+B/I/K (only when the feature is offered), Enter continues bulleted, numbered and quoted lists and ends them on an empty item, toggling prefixes/marks off, character count against maxlength, undo-friendly edits via insertText.
  • Feature sets: MarkdownDocument (legal notice/privacy: headings, tables, code blocks, dividers, …) and MarkdownInline (maintenance and status page descriptions: text formatting, links, lists, quotes, code).
  • Preview via POST /api/v1/markdown/preview (signed in, rate limited) with the same renderer as published pages.
  • Renderer no longer emits images (alt text only): external images on status pages would leak visitors' addresses to third parties. No raw HTML, no unsafe links as before.
  • Tests: renderer cases, preview endpoint, and the editor itself in headless Chromium (19 checks, skipped without Chromium).

Closes #73

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

- `MarkdownEditor` component (templ) + behavior in `app.js`: toolbar, Write/Preview tabs, Ctrl+B/I/K (only when the feature is offered), Enter continues bulleted, numbered and quoted lists and ends them on an empty item, toggling prefixes/marks off, character count against maxlength, undo-friendly edits via insertText. - Feature sets: `MarkdownDocument` (legal notice/privacy: headings, tables, code blocks, dividers, …) and `MarkdownInline` (maintenance and status page descriptions: text formatting, links, lists, quotes, code). - Preview via `POST /api/v1/markdown/preview` (signed in, rate limited) with the same renderer as published pages. - Renderer no longer emits images (alt text only): external images on status pages would leak visitors' addresses to third parties. No raw HTML, no unsafe links as before. - Tests: renderer cases, preview endpoint, and the editor itself in headless Chromium (19 checks, skipped without Chromium). Closes #73 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added this to the M6 Admin UI milestone 2026-11-22 09:51:03 +00:00
Sebi added 1 commit 2026-11-22 09:51:04 +00:00
Legal documents, maintenance and status page descriptions get an editor
with a toolbar of the formatting their field supports, keyboard
shortcuts, list continuation, a character count and a preview rendered
by the server. Images are no longer rendered: an external image on a
status page would hand every visitor's address to its host, so the
editor offers none. Editor behavior is tested in a headless browser
when Chromium is available.

Closes #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 4635defef3 into main 2026-11-22 10:29:13 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#74