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

Changesets are ignoring changes in marks #4

Open
mitar opened this issue Nov 18, 2018 · 5 comments
Open

Changesets are ignoring changes in marks #4

mitar opened this issue Nov 18, 2018 · 5 comments

Comments

@mitar
Copy link

mitar commented Nov 18, 2018

Maybe in addition to inserted and removed there should also be something like modified for those slices which had marks modified?

@marijnh
Copy link
Member

marijnh commented Nov 18, 2018

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, Step objects don't currently have a way to report modified-but-not-replaced ranges, so doing this would require an extension to that interface in prosemirror-transform.

@mitar
Copy link
Author

mitar commented Nov 18, 2018

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.

Also, Step objects don't currently have a way to report modified-but-not-replaced ranges,

Why would we need Step objects here? I would define a new Span, like ModifiedSpan, which would together with from, to, and data also have addedMarks and removedMarks which 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.

@RichieAHB
Copy link

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 ar will be promoted to a header.

Hea|der

p|ar

Is this due to:

Step objects don't currently have a way to report modified-but-not-replaced ranges

@marijnh
Copy link
Member

marijnh commented Nov 20, 2018

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!)

@RichieAHB
Copy link

Makes sense - thanks for the quick reply 👍 (and sorry for hijacking this issue)

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

No branches or pull requests

3 participants