Demo of jQuery.PrettyTextDiff

https://github.com/arnab/jQuery.PrettyTextDiff

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/diff_match_patch/20121119/diff_match_patch.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<div id="wrapper">
     <h3>
        Demo of
        <a href="https://github.com/arnab/jQuery.PrettyTextDiff" target="_blank">
            jQuery.PrettyTextDiff
        </a>
    </h3>

    <table class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th>Original</th>
                <th>Changed</th>
                <th>Diff</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="original">This si text 1</td>
                <td class="changed">This is text one</td>
                <td class="diff1"></td>
            </tr>
            <tr>
                <td class="original">Today is Jan the 24th, 2013</td>
                <td class="changed">Today is January the 25th of the year 2013</td>
                <td class="diff1"></td>
            </tr>
            <tr>
                <td class="original">A mouse is here<br/>text</td>
                <td class="changed">A sofa is here<br/>text</td>
                <td class="diff1"></td>
            </tr>
            <tr>
                <td >Some text here.</td>
                <td >Some more text which can be passed to this function.</td>
                <td class="diff2"></td>
            </tr>
         </tbody>
    </table>
    <div>
        <label class="checkbox">
            <input id="cleanup" type="checkbox" value="true" checked="checked" />
            Clean up diff - read more about
            <code>diff_cleanupEfficiency</code>
            <a href="http://code.google.com/p/google-diff-match-patch/wiki/API"
            target="_blank">
                here
            </a>
        </label>

        <input type='button1' class='btn btn-primary' value='Diff - CSS selector'></input>
        <input type='button2'...

SCSS

ins {
    background-color: #c6ffc6;
    text-decoration: none;
}

del {
    background-color: #ffc6c6;
}

div, table, h3, input, label {
    margin: 10px;
}

table th {
    width: 30%;
}

JavaScript

// Generated by CoffeeScript 1.7.1

/*
@preserve jQuery.PrettyTextDiff 1.0.4
See https://github.com/arnab/jQuery.PrettyTextDiff/
 */

(function() {
  let $;

  $ = jQuery;

  function diff_charsToLines(a, b){
    function c(a){
      for(var b = "", c = 0, f = -1, g = d.length; f < a.length - 1;){
        f = a.indexOf(" ", c);
        -1 == f && (f = a.length - 1);
        var r = a.substring(c, f + 1), c = f + 1;
        (e.hasOwnProperty ? e.hasOwnProperty(r) : void 0 !== e[r]) ? b += String.fromCharCode(e[r]) : (b += String.fromCharCode(g),
          e[r] = g,
            d[g++] = r);
      }
      return b;
    }
    var d = [], e = {};
    d[0] = "";
    var f = c(a), g = c(b);
    return {
      chars1: f,
      chars2: g,
      lineArray: d
    };
  }
  $.fn.extend({
    prettyTextDiff: function(options) {
      let dmp, settings;
      settings = {
        originalContainer: ".original",
        changedContainer: ".changed",
        diffContainer: ".diff",
        cleanup: true,
        debug: false
      };
      settings = $.extend(settings, options);
      $.fn.prettyTextDiff.debug("Options: ", settings, settings);
      dmp = new diff_match_patch();
      return this.each(function() {
        let changed, diff_as_html, diffs, original, containers;
        if (settings.originalContent && settings.changedContent) {
          original = $('<div />').html(settings.originalContent).text();
          changed = $('<div />').html(settings.changedContent).text();
        } else {
          containers = true;
          original = $($(settings.originalContainer, this).prop('outerHTML')?.replace(/<br\s*\/?>/gi, '\n')).text();
          changed = $($(settings.changedContainer, this).prop('outerHTML')?.replace(/<br\s*\/?>/gi, '\n')).text();
        }
        $.fn.prettyTextDiff.debug("Original text found: ", original, settings);
        $.fn.prettyTextDiff.debug("Changed  text found: ", changed, settings);
        if (settings.mode === "WORD" || settings.mode ===...