Repository navigation
feat(word-editor): editor toolbar and draft persistence/recovery - #320
Merged
Merged
Conversation
…ionality in utils
…istory management in editor
…ith editor for improved list handling
… numbering for selected lines
…ation in the editor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
src/lib/utils/index.jsfor 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.tests/unit/utils/index.test.jsto cover all new Markdown utility functions, including edge cases for toggling, continuing, and switching between inline and block formatting.src/pages/editor/edit/[word].astroandsrc/pages/editor/new/index.astroto include aconfirmDiscardproperty inreturnNav, prompting users to confirm before discarding unsaved changes. Thenavbar.astrocomponent is updated to reflect this property in its DOM.remark-breakspackage topackage.jsonas a new dependency, likely to improve Markdown rendering with soft line breaks.Related Issue
Screenshots/Screencasts
screen-capture.97.webm
Notes to Reviewer
NA