Skip to content

Commit

Permalink
Use SandBox for Custom HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jul 12, 2017
1 parent 84d279a commit c698ae1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/library/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TextareaAutosize from 'react-autosize-textarea';
*/
import { __ } from 'i18n';
import { Component } from 'element';
import { SandBox } from 'components';

/**
* Internal dependencies
Expand Down Expand Up @@ -95,7 +96,7 @@ registerBlockType( 'core/html', {
</InspectorControls>
}
{ preview
? <div dangerouslySetInnerHTML={ { __html: attributes.content } } />
? <SandBox html={ attributes.content } title={ __( 'Preview of custom HTML' ) } />
: <TextareaAutosize
value={ attributes.content }
onChange={ ( event ) => setAttributes( { content: event.target.value } ) }
Expand Down

0 comments on commit c698ae1

Please sign in to comment.