Changesets are ignoring changes in marks #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Maybe in addition to
insertedandremovedthere should also be something likemodifiedfor those slices which had marks modified?This is by design, currently, since modified ranges don't fit that well into the main use case for this, drawing insertions/deletions, and tracking them would further complicate an already tricky codebase. Also,
Stepobjects don't currently have a way to report modified-but-not-replaced ranges, so doing this would require an extension to that interface inprosemirror-transform.I understand that it would make this package more complicated, but that is one more reason to have it in a standard/maintained package. :-) Because it is tricky for somebody who is not really an expert in ProseMirror to really come up with this.
If you really want to display full diff to the users, then you need it, no? I mean, marks can sometimes be very meaningful.
Why would we need
Stepobjects here? I would define a newSpan, likeModifiedSpan, which would together withfrom,to, anddataalso haveaddedMarksandremovedMarkswhich would contain a list of added and removed marks on that span in the current document.I do not think we have to care about marks in the deleted content. But marks in preserved/existing content and diff on them would be useful.
I'm not sure whether his is related but diffs are also not show between changes in block type. So when deleting the content between the text below
arwill be promoted to a header.Is this due to:
Yes, that's also by design too. (This is a rather narrow library designed to fit a specific use case, and I'm not prepared to increase its scope. If someone who has more time for it were to fork it, that'd be great, of course!)
Makes sense - thanks for the quick reply 👍 (and sorry for hijacking this issue)
I've added a configuration option to the ChangeSet library to track changes in marks as well as in nodes. It does not modify the default behavior of the library, but it adds this feature as a configuration option instead.
I know this might be out of scope of the prosemirror-changeset library. However, many popular features of our library, Tiptap, involve tracking when a user (or an AI assistant) changes the format of an element in the document, and showing that change in the UI so that other users can review it. So we're curious to know what you think of this feature, and if it could be supported by prosemirror-changeset.
You can now customize the diff behavior by passing a token encoder.
Ooo, so great! Thanks. Interesting approach.