Repository navigation
fix(editor): ignore markdown normalization in dirty state - #63
Merged
Merged
Conversation
The host editor round-trips markdown through its own serializer. Escaping such as ~ to \~ and trailing newlines can change the text without a user edit, so comparing against the stored markdown reported untouched notes as unsaved. Capture the editor output after loading as the clean baseline and compare dirty checks, saves and resets against it. Add unit coverage for the baseline and run the extension tests in CI. Closes #62
Owner
Author
|
Tested the branch build on the live instance with an isolated account:
Unit tests 4/4, typecheck and build pass. The branch build is deployed for the maintainer visual check before merge. |
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.
The host editor 9.1 round-trips markdown through
@tiptap/markdown. Opening a note can change its serialized form without any user edit: for example~12 kmbecomes\~12 kmand an extra trailing newline is added. The dirty guard compared that output with the raw markdown received from the Notes API, so every untouched note was reported as unsaved and switching notes opened the confirmation dialog.This captures the editor output after loading a note as the clean baseline. Dirty checks, save decisions and reset/discard now compare against that baseline instead of the stored raw content.
Verification:
npm test: 4 tests passed, including a regression case where stored and serialized markdown differ but the note is clean.npm run check:types: exit 0.npm run build: exit 0.Unsaved changesconsistently.Closes #62