15 lines
303 B
JavaScript
15 lines
303 B
JavaScript
|
/** @format */
|
||
|
/**
|
||
|
* External dependencies
|
||
|
*/
|
||
|
import { sanitize } from 'dompurify';
|
||
|
|
||
|
export const ALLOWED_TAGS = [ 'a', 'b', 'em', 'i', 'strong' ];
|
||
|
export const ALLOWED_ATTR = [ 'target', 'href' ];
|
||
|
|
||
|
export default html => {
|
||
|
return {
|
||
|
__html: sanitize( html, { ALLOWED_TAGS, ALLOWED_ATTR } ),
|
||
|
};
|
||
|
};
|