Open
Conversation
danblaker
requested changes
Sep 17, 2025
danblaker
left a comment
There was a problem hiding this comment.
I don't think we should merge this until it uses a generic approach, e.g. support for diffing specified attributes, rather than OUR-specific tags.
pvande
requested changes
Sep 22, 2025
pvande
left a comment
There was a problem hiding this comment.
I know frustratingly little about how this is implemented or how it is being used, so I don't feel confident speaking to whether this is fit for purpose or an ideal approach.
I will note that there is no testing around this change, which we should probably remedy before merging — that will at minimum allow us to refactor things in the future, if a better approach reveals itself.
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.
Some scenarios involving intentionally blank tags were resulting in mismatched HTML, after being diffed, like a LaTex
spanfollowed by a writing blankspanthat is then replaced by a second LaTexspan. This branch adds support for tags that are intentionally left empty by treating them as unified "words" to be diffed as a whole.It also adds an optional
compare_tag_attributesargument to be used in thesame_tag?method on theOperationsclass. Previously, tags with the same name and different attributes were always treated as "equal" when being diffed, resulting in unpredictable outcomes when, for example, a writing blankspanis replaced by a latexspan', or an embedded image is replaced by a different image (where the only tag difference is thesrcattribute). Optionally passing incompare_tag_attributes` allows us to treat tags with different attributes as entirely different content when necessary.