Skip to content

feat(word-editor): editor toolbar and draft persistence/recovery - #320

Merged
babblebey merged 14 commits into
mainfrom
word-editor
Nov 18, 2026
Merged

babblebey merged 14 commits into
mainfrom
word-editor

Conversation

@babblebey

Copy link
Copy Markdown
Member

Description

This pull request adds advanced Markdown editing utilities to the word editor, enabling programmatic manipulation of lists, inline formatting, and code blocks. It also introduces drafts persistence per word in browser storage, restore them on return, and improves the editor navigation experience by prompting users to confirm discarding changes when navigating away. Adds comprehensive unit tests for these utilities.

Changes Made:

  • Adds several utility functions to src/lib/utils/index.js for toggling Markdown list prefixes (toggleMarkdownListPrefix), continuing lists on Enter (continueMarkdownListOnEnter), toggling inline formatting (toggleMarkdownWrap), and toggling code blocks (toggleMarkdownCodeBlock). These functions support both single-line and multi-line selections, and handle complex Markdown edge cases.
  • Introduces extensive unit tests in tests/unit/utils/index.test.js to cover all new Markdown utility functions, including edge cases for toggling, continuing, and switching between inline and block formatting.
  • Modifies the editor navigation in src/pages/editor/edit/[word].astro and src/pages/editor/new/index.astro to include a confirmDiscard property in returnNav, prompting users to confirm before discarding unsaved changes. The navbar.astro component is updated to reflect this property in its DOM.
  • Adds the remark-breaks package to package.json as a new dependency, likely to improve Markdown rendering with soft line breaks.

Related Issue

Screenshots/Screencasts

screen-capture.97.webm

Notes to Reviewer

NA

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
jargons-dev Ready Ready Preview Nov 18, 2026 10:24am UTC

@babblebey babblebey changed the title Word editor feat(word-editor): editor toolbar and draft recovery Nov 18, 2026
@babblebey babblebey changed the title feat(word-editor): editor toolbar and draft recovery feat(word-editor): editor toolbar and draft persistence/recovery Nov 18, 2026
@babblebey
babblebey merged commit 87d38e0 into main Nov 18, 2026
6 checks passed
@babblebey
babblebey deleted the word-editor branch November 18, 2026 11:08

This branch was successfully deployed

1 active deployment
Preview — 96761984 Deployed Nov 18, 2026 by vercel[bot]
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