-
Notifications
You must be signed in to change notification settings - Fork 100
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
Some diff operations include actions that cancel each other out #90
Comments
Closed
Hey, this is interesting. I'll happily merge a fix. |
Hi @johanneswilm |
rzhornyk
added a commit
to rzhornyk/diffDOM
that referenced
this issue
Sep 28, 2020
smaller diffs, fixes fiduswriter#90
Closed
clarkf
added a commit
to clarkf/matrix-react-sdk
that referenced
this issue
Jan 29, 2023
Workaround is no longer necessary as of DiffDOM 4.2.1 See fiduswriter/diffDOM#90 Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
t3chguy
pushed a commit
to matrix-org/matrix-react-sdk
that referenced
this issue
Jan 31, 2023
* noImplicitAny fixes for MessageDiffUtils Signed-off-by: Clark Fischer <clark.fischer@gmail.com> * Add tests for MessageDiffUtils Adds mostly snapshot tests for MessageDiffUtils to guarantee consistent behavior. Signed-off-by: Clark Fischer <clark.fischer@gmail.com> * Strict mode fixes for MessageDiffUtils Gets `MessageDiffUtils` to pass under `tsc --strict`. Fixes element-hq/element-web#23665 - no longer errors, though it still isn't correct. Signed-off-by: Clark Fischer <clark.fischer@gmail.com> * Remove obsolete DiffDOM workaround Workaround is no longer necessary as of DiffDOM 4.2.1 See fiduswriter/diffDOM#90 Signed-off-by: Clark Fischer <clark.fischer@gmail.com> --------- Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With
diff-dom
4.1.3
, I'm diffing these two strings:Using
new DiffDOM().diff("<div><em>foo</em> bar baz</div>","<div><em>foo</em> bar bay</div>")
, I get the following back:The first diff action is correct, but then the second and third cancel each other out and are redundant, and in my case even bothersome.
I'm using these, not to apply them to a DOM, but to visually mark the difference between two DOM trees (wrapping in
<del>
and<ins>
), so having extra actions in there that shouldn't be shown messes it up a bit.I've got a workaround, detecting exactly this case, but wanted to report as it's something potentially worth fixing.
The text was updated successfully, but these errors were encountered: