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

Self-closing elements should be equivalent #135

Open
i-like-robots opened this issue Jan 25, 2016 · 0 comments
Open

Self-closing elements should be equivalent #135

i-like-robots opened this issue Jan 25, 2016 · 0 comments

Comments

@i-like-robots
Copy link

Currently optionally self-closing elements such as images and line breaks are not considered equivalent. E.G.

const differ = require('html-differ')

let lhs = '<div><br></div>'
let rhs = '<div><br /></div>'

let diff = differ.diffHtml(lhs, rhs) 

console.log(diff)

// [
//   {
//     "value": "<div><br"
//   },
//   {
//     "value": "/",
//     "added": true
//   },
//   {
//     "value": "></div>"
//   }
// ]

For reference Parse5 and htmlparser2 interpret both strings equally. I'm looking into this to see if I can help.

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

Successfully merging a pull request may close this issue.

1 participant