diff --git a/blocks/library/html/editor.scss b/blocks/library/html/editor.scss
index 40409e2c819c4..6a76fd7d37657 100644
--- a/blocks/library/html/editor.scss
+++ b/blocks/library/html/editor.scss
@@ -1,9 +1,25 @@
-.wp-block-html.blocks-plain-text {
- font-family: $editor-html-font;
- font-size: $text-editor-font-size;
- color: $dark-gray-800;
- padding: .8em 1.6em;
- overflow-x: auto !important;
- border: 1px solid $light-gray-500;
- border-radius: 4px;
+.gutenberg .wp-block-html {
+ iframe {
+ display: block;
+
+ // Disable pointer events so that we can click on the block to select it
+ pointer-events: none;
+ }
+
+ .CodeMirror {
+ border-radius: 4px;
+ border: 1px solid $light-gray-500;
+ font-family: $editor-html-font;
+ font-size: $text-editor-font-size;
+ height: auto;
+ }
+
+ .CodeMirror-gutters {
+ background: $white;
+ border-right: none;
+ }
+
+ .CodeMirror-lines {
+ padding: 8px 8px 8px 0;
+ }
}
diff --git a/blocks/library/html/index.js b/blocks/library/html/index.js
index 9ed3e582b7294..8ed57744305e3 100644
--- a/blocks/library/html/index.js
+++ b/blocks/library/html/index.js
@@ -3,14 +3,13 @@
*/
import { RawHTML } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
-import { withState } from '@wordpress/components';
+import { withState, SandBox, CodeEditor } from '@wordpress/components';
/**
* Internal dependencies
*/
import './editor.scss';
import BlockControls from '../../block-controls';
-import PlainText from '../../plain-text';
export const name = 'core/html';
@@ -49,35 +48,38 @@ export const settings = {
edit: withState( {
preview: false,
- } )( ( { attributes, setAttributes, setState, isSelected, preview } ) => [
- isSelected && (
-