2018-10-12 20:40:16 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { sanitize } from 'dompurify';
|
|
|
|
|
2019-05-29 22:28:37 +00:00
|
|
|
export const ALLOWED_TAGS = [ 'a', 'b', 'em', 'i', 'strong', 'p' ];
|
2019-05-21 19:34:33 +00:00
|
|
|
export const ALLOWED_ATTR = [ 'target', 'href', 'rel', 'name', 'download' ];
|
2018-10-12 20:40:16 +00:00
|
|
|
|
|
|
|
export default html => {
|
|
|
|
return {
|
|
|
|
__html: sanitize( html, { ALLOWED_TAGS, ALLOWED_ATTR } ),
|
|
|
|
};
|
|
|
|
};
|