FEATURE: add table support
This commit is contained in:
parent
bf592c0ee7
commit
e9f55adb3a
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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]'
|
||||
]);
|
||||
}
|
Loading…
Reference in New Issue