Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Changing tag doesn't count as difference #10

Open
dmitrymurashenkov opened this issue Mar 24, 2019 · 1 comment
Open

Changing tag doesn't count as difference #10

dmitrymurashenkov opened this issue Mar 24, 2019 · 1 comment

Comments

@dmitrymurashenkov
Copy link

dmitrymurashenkov commented Mar 24, 2019

For example changing <b> to <i> doesn't result in addition of <ins>/<del> tags.

Made an example:

https://codepen.io/anon/pen/EMrRJG

let originalHTML = `This text is <b>bold</b>.`;

let newHTML = `This text is <i>bold</i>.`;

// Diff HTML strings
let output = htmldiff(originalHTML, newHTML);

Result:

This text is <b><i>bold</i></b>.
@danivalls
Copy link

I was about to post the same issue. Actually, you can change both the tag name itself or the attributes and no changes will be detected. This should be a high-priority fix, imho.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants