diff --git a/web/app.js b/web/app.js
index fae28ba..5bff2e8 100644
--- a/web/app.js
+++ b/web/app.js
@@ -768,7 +768,7 @@
${fmtDateLong(e.created_at)}
${e.title ? `
context
@@ -825,9 +825,13 @@
if (!hasDecision && e.body) {
const lang = data.lang || '';
+ const isCode = lang || e.card_type === 'snippet';
+ const bodyHtml = isCode
+ ? `
`
+ : `
${renderMd(e.body)}
`;
sections += `
content${lang ? `${lang}` : ''}${hasFill ? `` : ''}
-
+
${bodyHtml}
`;
}
@@ -1629,6 +1633,12 @@
return escHtml(s).replace(/'/g, ''');
}
+ function renderMd(s) {
+ if (!s) return '';
+ if (typeof marked === 'undefined') return escHtml(s);
+ return marked.parse(s, { breaks: true });
+ }
+
function isSafeUrl(url) {
return /^https?:\/\//i.test(url);
}
diff --git a/web/index.html b/web/index.html
index 2c29c7b..0f2c4d9 100644
--- a/web/index.html
+++ b/web/index.html
@@ -82,6 +82,7 @@
+