mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -06:00
32 lines
637 B
JavaScript
32 lines
637 B
JavaScript
export function setup(helper) {
|
|
|
|
if (!helper.markdownIt) { return; }
|
|
|
|
// this is built in now
|
|
// TODO: sanitizer needs fixing, does not properly support this yet
|
|
|
|
// we need a custom callback for style handling
|
|
helper.whiteList({
|
|
custom: function(tag,attr,val) {
|
|
if (tag !== 'th' && tag !== 'td') {
|
|
return false;
|
|
}
|
|
|
|
if (attr !== 'style') {
|
|
return false;
|
|
}
|
|
|
|
return (val === 'text-align:right' || val === 'text-align:left' || val === 'text-align:center');
|
|
}
|
|
});
|
|
|
|
helper.whiteList([
|
|
'table',
|
|
'tbody',
|
|
'thead',
|
|
'tr',
|
|
'th',
|
|
'td',
|
|
]);
|
|
}
|