]*>(.*?)<\/h\1>/ig, function(a, b, c) {
return '\n' + ('######'.slice(0, b)) + ' ' + c + '\n';
}],
li: [/<(li)\b[^>]*>(.*?)<\/\1>/ig, '* $2\n'],
blockquote: [/<(blockquote)\b[^>]*>(.*?)<\/\1>/ig, '\n> $2\n'],
pre: [/]*>(.*?)<\/pre>/ig, '\n```\n$1\n```\n'],
code: [/]*>(.*?)<\/code>/ig, '\n`\n$1\n`\n'],
p: [/]*>(.*?)<\/p>/ig, '\n$1\n'],
hr: [/
]*>/ig, '\n---\n']
};
InlineEditor.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.ElementorInlineEditor = InlineEditor;
}
}(window, document));