2016-12-14 19:54:17 +00:00
|
|
|
// Module App.BlogEntry
|
|
|
|
|
2016-12-15 02:23:07 +00:00
|
|
|
function htmlDecode(input) {
|
|
|
|
var doc = new DOMParser().parseFromString(input, "text/html");
|
|
|
|
return doc.documentElement.textContent;
|
|
|
|
}
|
|
|
|
|
2016-12-14 19:54:17 +00:00
|
|
|
exports.mdify = function(id) {
|
|
|
|
var converter = new showdown.Converter()
|
|
|
|
elem = document.getElementById(id);
|
|
|
|
md = elem.innerHTML;
|
2016-12-15 02:23:07 +00:00
|
|
|
elem.innerHTML = htmlDecode(converter.makeHtml(md));
|
2016-12-14 19:54:17 +00:00
|
|
|
return "done :)";
|
|
|
|
}
|