myobie / htmldiff Goto Github PK
View Code? Open in Web Editor NEWA diff library that uses html tags to show differences
License: MIT License
A diff library that uses html tags to show differences
License: MIT License
The code is this repo is very old and is here to be read and learned from. It is not maintained. ๐ถ - - - class Stuff class << self include HTMLDiff end # or extend HTMLDiff ? end Stuff.diff('a word is here', 'a nother word is there') # => 'a<ins class=\"diffins\"> nother</ins> word is <del class=\"diffmod\">here</del><ins class=\"diffmod\">there</ins>' Checkout the crappy specs for good examples.
hi
I want to know how can I ignore the white spaces which too get into
account while taking the difference between the two html
I mean if I have an html like this
<html>
<body>
hi in body
</body>
</html>
and suppose I insert a space between the html an body tag like this
<html>
[space]
<body>
hi in body
</body>
</html>
then that white space is also consider as a difference which is true
but I want only those differences where certian text is changed or added
that mean i want to ignore whitespaces differences
Any Idea
Thank Anyway
Documenting results I found to be suprising:
installed via npm, [email protected]
Combining tags from both before and after:
diff('<p>a <b>test</b></p>', '<p>a <div>test</div></p>')
'<p>a <b><div>test</b></div></p>'
Would not expect 'b' tag to remain in diff if it was not inside a tag.
keeping tags
diff('<p>a <b>test</b></p>', '<p>a test</p>')
'<p>a <b>test</b></p>'
Would expect '
a testtest
Remove a tag and edit text is a little better:
diff('<p>a <b>test</b></p>', '<p>a testt</p>')
'<p>a <b><del>test</del></b><ins>testt</ins></p>'
Hello,
I have found an issue with html tables.
I have provided the detailed description here - in Issues of C# port of the htmldiff library.
See thedetails here: Rohland/htmldiff.net#5
I have tried my test files http://dimaka.com/download/Issue_html_diff_tables.zip
and got the same issue with Ruby script.
Could you please let me know how to fix it?
And if you are going to update the sources - when it could happen?
Thank you in advance!
1.9.3p194 :041 > Stuff.diff "<ul><li>hi<//li><//ul>", "<ol><li>hi<//li><//ol>"
=> "<ul><ol><li>hi<//li><//ul><//ol>"
Should probably do something else.
With an HTML file of around 600 lines, the program never finishes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.