Skip to content

Elements with matching IDs or classes are not matched more strongly #49

@edg2s

Description

@edg2s

Although there is special code for creating identifiers based on ID or class, they don't change the behaviour of findCommonSubsets, as roughlyEqual gives the same result (true) for comparing <p id="foo"> with <p id="foo"> as it does <p id="foo"> with <p id="bar">.

The result is changing a document from

<p id="A"></p><p id="B"></p><p id="C"></p> to <p id="A"></p><p id="C"></p>

results in an overly complicated diff of

{"action":"removeElement","route":[0],"element":{"nodeName":"P","attributes":{"id":"A"}}},
{"action":"modifyAttribute","route":[0],"name":"id","oldValue":"B","newValue":"A"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions