Skip to content
Diff algorithm that understands HTML, in the browser.
CoffeeScript JavaScript
Branch: master
Clone or download

Latest commit

Latest commit 84bdd87 Aug 14, 2012

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src single space equals combine with replaces Aug 14, 2012
test single space equals combine with replaces Aug 14, 2012
.gitignore Initial spec passing! Aug 6, 2012
.travis.yml travis-ci stuff Aug 6, 2012
LICENSE First commit. Aug 6, 2012
README.md Made it multi-module Aug 10, 2012
package.json version bump Aug 14, 2012

README.md

htmldiff.js

HTML Diffing in JavaScript (ok, CoffeeScript actually.)

Build Status

htmldiff.js is a CoffeeScript port of https://github.com/myobie/htmldiff (This one has a few more tests.)

This is diffing that understands HTML. Best suited for cases when you want to show a diff of user-generated HTML (like from a wysiwyg editor).

##Usage You use it like this:

  diff = require 'htmldiff.js'
  console.log diff '<p>this is some text</p>', '<p>this is some more text</p>'

And you get:

<p>this is some <ins>more </ins>text</p>

##Module

It should be multi-module aware. ie. it should work as a node.js module or an AMD (RequireJS) module, or even just as a script tag.

Licensed under the MIT License. See the LICENSE file for details.

You can’t perform that action at this time.