FEATURE: add table support

This commit is contained in:
Sam 2017-06-26 13:24:55 -04:00
parent bf592c0ee7
commit e9f55adb3a
3 changed files with 24 additions and 1 deletions

View File

@ -9,3 +9,4 @@
//= require ./pretty-text/engines/markdown-it/code
//= require ./pretty-text/engines/markdown-it/category-hashtag
//= require ./pretty-text/engines/markdown-it/censored
//= require ./pretty-text/engines/markdown-it/table

View File

@ -164,7 +164,8 @@ export function cook(raw, opts) {
opts.discourse.hoisted = hoisted;
let cooked = opts.discourse.sanitizer(opts.engine.render(raw), whiteLister).trim();
const rendered = opts.engine.render(raw);
let cooked = opts.discourse.sanitizer(rendered, whiteLister).trim();
const keys = Object.keys(hoisted);
if (keys.length) {

View File

@ -0,0 +1,21 @@
export function setup(helper) {
if (!helper.markdownIt) { return; }
// this is built in now
// TODO: sanitizer needs fixing, does not properly support this yet
helper.whiteList([
'table',
'th[style=text-align:right]',
'th[style=text-align:left]',
'th[style=text-align:center]',
'tbody',
'thead',
'tr',
'th',
'td',
'td[style=text-align:right]',
'td[style=text-align:left]',
'td[style=text-align:center]'
]);
}