Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix removeMark #14

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

BrianHung
Copy link
Contributor

Removing marks broke with #8, specifically within the handleMark function.

d1abb5c#diff-1cdd5cad54822249d22829cef95393e37707fcdb58e789e1a217c9f847ff9d9aL114-L120

This PR reimplements removing marks by checking if mark value is null, which is the only way we know that a mark is deleted as the MarkPatch type is not that expressive (Peritext has separate AddMark and RemoveMark patches).

type MarkPatch = {
	action: 'mark';
	path: Prop[];
	marks: am.Mark[];
};

Slightly awkward with ProseMirror's API, as you can create a mark passing in null (defaultAttrs is used to fill in missing attrs).

Fixes #12

@BrianHung
Copy link
Contributor Author

BrianHung commented Aug 1, 2024

Automerge does seem to have an UnmarkPatch., but it is also currently unused.

I would expect this to be used when you call Automerge.unmark(). But in @automerge/[email protected], I instead get a MarkPatch with value null.

@BrianHung BrianHung marked this pull request as draft August 1, 2024 22:27
@BrianHung BrianHung marked this pull request as ready for review August 1, 2024 23:03
@alexjg alexjg merged commit 261267c into automerge:main Aug 5, 2024
4 checks passed
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.

Remove-mark functionality broken in v0.0.13-alpha.1
2 participants