Skip to content

Commit 9119090

Browse files
authored
Update main.js
1 parent ab2dea7 commit 9119090

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
}
2121
location.search = query; // page will be refreshed
2222
}
23+
24+
var document.showdown = require('showdown'),
25+
document.converter = new showdown.Converter(),
26+
2327

2428
document.getElementById('submit').onclick = submit;
2529
document.onkeypress = function (e) {
@@ -47,7 +51,10 @@
4751
.then(function (res) {
4852
return res.json().then(function (body) {
4953
if (res.status === 200) {
50-
return body;
54+
55+
56+
html = converter.makeHtml(body);
57+
return html;
5158
}
5259
console.log(res, body); // debug
5360
throw new Error('Gist <strong>' + gistId + '</strong>, ' + body.message.replace(/\(.*\)/, ''));

0 commit comments

Comments
 (0)