!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.toMarkdown=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={"exports":{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g-1?b.documentElement.innerHTML=a:b.body.innerHTML=a,b},a}function i(a){var b=(new z).parseFromString(a,"text/html");return v(b,e),b}function j(a){for(var b,c,d,e=[a],f=[];e.length>0;)for(b=e.shift(),f.push(b),c=b.childNodes,d=0;d<",">"+b+"<")}function m(a,b){if("string"==typeof b)return b===a.nodeName.toLowerCase();if(Array.isArray(b))return-1!==b.indexOf(a.nodeName.toLowerCase());if("function"==typeof b)return b.call(q,a);throw new TypeError("`filter` needs to be a string, array, or function")}function n(a,b){var c,d,f;return"left"===a?(c=b.previousSibling,d=/ $/):(c=b.nextSibling,d=/^ /),c&&(3===c.nodeType?f=d.test(c.nodeValue):1!==c.nodeType||e(c)||(f=d.test(c.textContent))),f}function o(a){var b="",c="";if(!e(a)){var d=/^[ \r\n\t]/.test(a.innerHTML),f=/[ \r\n\t]$/.test(a.innerHTML);d&&!n("left",a)&&(b=" "),f&&!n("right",a)&&(c=" ")}return{"leading":b,"trailing":c}}function p(a){var b,c=k(a);if(!f(a)&&!/A/.test(a.nodeName)&&/^\s*$/i.test(c))return void(a._replacement="");for(var e=0;e=0;f--)p(e[f]);return c=k(d),c.replace(/^[\t\r\n]+|[\t\r\n\s]+$/g,"").replace(/\n\s+\n/g,"\n\n").replace(/\n{3,}/g,"\n\n")},q.isBlock=e,q.isVoid=f,q.trim=d,q.outer=l,b.exports=q},{"./lib/gfm-converters":2,"./lib/md-converters":3,"collapse-whitespace":4,"jsdom":7}],"2":[function(a,b,c){"use strict";function d(a,b){var c=Array.prototype.indexOf.call(b.parentNode.childNodes,b),d=" ";return 0===c&&(d="| "),d+a+" |"}var e=/highlight highlight-(\S+)/;b.exports=[{"filter":"br","replacement":function(){return"\n"}},{"filter":["del","s","strike"],"replacement":function(a){return"~~"+a+"~~"}},{"filter":function(a){return"checkbox"===a.type&&"LI"===a.parentNode.nodeName},"replacement":function(a,b){return(b.checked?"[x]":"[ ]")+" "}},{"filter":["th","td"],"replacement":function(a,b){return d(a,b)}},{"filter":"tr","replacement":function(a,b){var c="",e={"left":":--","right":"--:","center":":-:"};if("THEAD"===b.parentNode.nodeName)for(var f=0;fe;e++)d+="#";return"\n\n"+d+" "+a+"\n\n"}},{"filter":"hr","replacement":function(){return"\n\n* * *\n\n"}},{"filter":["em","i"],"replacement":function(a){return"_"+a+"_"}},{"filter":["strong","b"],"replacement":function(a){return"**"+a+"**"}},{"filter":function(a){var b=a.previousSibling||a.nextSibling,c="PRE"===a.parentNode.nodeName&&!b;return"CODE"===a.nodeName&&!c},"replacement":function(a){return"`"+a+"`"}},{"filter":function(a){return"A"===a.nodeName&&a.getAttribute("href")},"replacement":function(a,b){var c=b.title?' "'+b.title+'"':"";return"["+a+"]("+b.getAttribute("href")+c+")"}},{"filter":"img","replacement":function(a,b){var c=b.alt||"",d=b.getAttribute("src")||"",e=b.title||"",f=e?' "'+e+'"':"";return d?"!["+c+"]("+d+f+")":""}},{"filter":function(a){return"PRE"===a.nodeName&&"CODE"===a.firstChild.nodeName},"replacement":function(a,b){return"\n\n "+b.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},{"filter":"blockquote","replacement":function(a){return a=this.trim(a),a=a.replace(/\n{3,}/g,"\n\n"),a=a.replace(/^/gm,"> "),"\n\n"+a+"\n\n"}},{"filter":"li","replacement":function(a,b){a=a.replace(/^\s+/,"").replace(/\n/gm,"\n ");var c="* ",d=b.parentNode,e=Array.prototype.indexOf.call(d.children,b)+1;return c=/ol/i.test(d.nodeName)?e+". ":"* ",c+a}},{"filter":["ul","ol"],"replacement":function(a,b){for(var c=[],d=0;d