]*>(.*?)<\/pre>/ig, '\n```\n$1\n```\n'], p: [/]*>(.*?)<\/p>/ig, '\n$1\n'], hr: [/
]*>/ig, '\n---\n'] }; Pen.prototype.toMd = function() { var html = this.getContent() .replace(/\n+/g, '') // remove line break .replace(/<([uo])l\b[^>]*>(.*?)<\/\1l>/ig, '$2'); // remove ul/ol for(var p in regs) { if (regs.hasOwnProperty(p)) html = html.replace.apply(html, regs[p]); } return html.replace(/\*{5}/g, '**'); }; // make it accessible if (doc.getSelection) { selection = doc.getSelection(); root.Pen = Pen; } }(window, document));