From 8ffa953b8e0058e4fcd8a35144ddc2b8480fdd58 Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 30 Nov 2016 07:01:13 +0800 Subject: [PATCH] UI for markdown tables and blockquotes --- utility.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utility.js b/utility.js index 62f7ecc..58556bf 100644 --- a/utility.js +++ b/utility.js @@ -39,14 +39,16 @@ module.exports = { return path.resolve.apply(null, a); }, markdown(obj, keys) { - let replacePre = s => { - return s.split('
').join('
').split('
').join('
') + let replaceUI = s => { + return s.split('
').join('
').split('
').join('
') + .split('').join('
') + .split('
').join('
').split('
').join(''); } return new Promise((resolve, reject) => { if (!keys) { if (!obj || !obj.trim()) resolve(""); else renderer(obj, s => { - resolve(replacePre(s)); + resolve(replaceUI(s)); }); } else { let res = obj, cnt = 0; @@ -54,7 +56,7 @@ module.exports = { if (res[key].trim()) { cnt++; renderer(res[key], (s) => { - res[key] = replacePre(s); + res[key] = replaceUI(s); if (!--cnt) resolve(res); }); }