Skip to content

robhicks/htmldiff.mjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htmldiff-mjs

HTML Diffing in JavaScript

Build Status

htmldiff-mjs is a EmcaScript 2015 port of https://github.com/tnwinc/htmldiff.js which is a port of https://github.com/myobie/htmldiff.

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:

import { diff } from 'htmldiff-mjs';

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>

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

About

Diff algorithm that understands HTML, in the browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 69.6%
  • JavaScript 30.4%