diff --git a/blocks/components/editable/index.js b/blocks/components/editable/index.js index 305f3b358f5459..2bd6a232058806 100644 --- a/blocks/components/editable/index.js +++ b/blocks/components/editable/index.js @@ -320,7 +320,16 @@ export default class Editable extends wp.element.Component { } render() { - const { tagName, style, value, focus, className, showAlignments = false, formattingControls } = this.props; + const { + tagName, + style, + value, + focus, + className, + showAlignments = false, + inline, + formattingControls + } = this.props; const classes = classnames( 'blocks-editable', className ); // Generating a key that includes `tagName` ensures that if the tag @@ -335,6 +344,9 @@ export default class Editable extends wp.element.Component { style={ style } className={ classes } defaultValue={ value } + settings={ { + forced_root_block: inline ? false : 'p' + } } key={ key } /> ); diff --git a/blocks/components/editable/style.scss b/blocks/components/editable/style.scss index 6447e96c0b1d9e..1e6c8f6dd8ba50 100644 --- a/blocks/components/editable/style.scss +++ b/blocks/components/editable/style.scss @@ -26,10 +26,7 @@ figcaption.blocks-editable { margin-top: 0.5em; color: $dark-gray-100; text-align: center; - - p { - font-size: $default-font-size; - } + font-size: $default-font-size; } diff --git a/blocks/components/editable/tinymce.js b/blocks/components/editable/tinymce.js index 30d17227613ba1..e50e0b72f75e4d 100644 --- a/blocks/components/editable/tinymce.js +++ b/blocks/components/editable/tinymce.js @@ -21,6 +21,8 @@ export default class TinyMCE extends wp.element.Component { } initialize() { + const { settings, focus } = this.props; + tinymce.init( { target: this.editorNode, theme: false, @@ -35,10 +37,11 @@ export default class TinyMCE extends wp.element.Component { }, formats: { strikethrough: { inline: 'del' } - } + }, + ...settings } ); - if ( this.props.focus ) { + if ( focus ) { this.editorNode.focus(); } } diff --git a/blocks/library/button/index.js b/blocks/library/button/index.js index 81917d246c88cd..0dc22cc14938e7 100644 --- a/blocks/library/button/index.js +++ b/blocks/library/button/index.js @@ -74,6 +74,7 @@ registerBlock( 'core/button', { value={ text } onFocus={ setFocus } onChange={ ( value ) => setAttributes( { text: value } ) } + inline /> { focus &&