From 8eb4860ec893ae5cb36a454c71095204ea1ef896 Mon Sep 17 00:00:00 2001 From: iseulde Date: Wed, 8 Mar 2017 17:39:51 +0100 Subject: [PATCH] Adjust inserting for heading and paragraph --- tinymce-single/blocks/elements/headings/register.js | 5 +++-- tinymce-single/blocks/elements/paragraph/register.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tinymce-single/blocks/elements/headings/register.js b/tinymce-single/blocks/elements/headings/register.js index 20b166c097d46..dc3a3caf680a7 100644 --- a/tinymce-single/blocks/elements/headings/register.js +++ b/tinymce-single/blocks/elements/headings/register.js @@ -33,8 +33,9 @@ type: 'text', icon: 'gridicons-heading', controls: getControls(), - insert: function() { - + insert: function( block, editor ) { + // Maybe detect best heading based on document outline. + editor.formatter.apply( 'h1', block ); } } ); } )( window.wp ); diff --git a/tinymce-single/blocks/elements/paragraph/register.js b/tinymce-single/blocks/elements/paragraph/register.js index b346a55f14dfb..990baac095f0f 100644 --- a/tinymce-single/blocks/elements/paragraph/register.js +++ b/tinymce-single/blocks/elements/paragraph/register.js @@ -34,6 +34,6 @@ window.wp.blocks.registerBlock( { 'text-align-right' ], insert: function( block, editor ) { - editor.formatter.apply( 'paragraph', block ); + editor.formatter.apply( 'p', block ); } } );