// Generated by CoffeeScript 1.10.0
(function() {
  $("blockquote").each((function(_this) {
    return function(i, element) {
      var contents;
      contents = $(element).contents();
      console.log(contents);
      contents.insertAfter($(element));
      return $(element).remove();
    };
  })(this));

}).call(this);

function filterF(i, el) {
  var pattern = /(From|To|Subject|Cc|Date):/i;
  return el.textContent.match(pattern);
}

$($("blockquote").get().reverse()).each(function(i, el) {
  var contents = $(el).contents();
  var matches = contents.find("*").filter(filterF).get().reverse();

  while (matches.length > 0) {
    matches[0].remove();
    matches = contents.find("*").filter(filterF).get().reverse();
  }

  // remove blockquotes but preserve contents
  contents.insertAfter($(el));
  $(el).remove();
});

Remove (From|To|Subject|Cc|Date) from the trace
Remove (From|To|Subject|Cc|Date) from the trace
