Added code highlighting

This commit is contained in:
Jori Lallo
2016-05-22 22:08:09 -07:00
parent 84b3b8ee39
commit d53bd8cebb
9 changed files with 144 additions and 24 deletions

View File

@ -1,18 +0,0 @@
import truncate from 'truncate-html';
import marked from 'marked';
truncate.defaultOptions = {
stripTags: false,
ellipsis: '...',
decodeEntities: false,
excludes: ['h1', 'pre',],
};
const truncateMarkdown = (text, length) => {
const html = marked(text);
return truncate(html, length);
};
export {
truncateMarkdown
};