From d5350b412fc99173ca07a36d4d15c9397b425c0d 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 20b166c097d462..dc3a3caf680a78 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 b346a55f14dfb9..990baac095f0f2 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 ); } } );