Skip to content

Commit

Permalink
Merge pull request #212 from WordPress/add/tinymce-single/insert
Browse files Browse the repository at this point in the history
Adjust inserting for heading and paragraph
  • Loading branch information
ellatrix authored Mar 8, 2017
2 parents fdb5cf8 + d5350b4 commit 8848ab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tinymce-single/blocks/elements/headings/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
2 changes: 1 addition & 1 deletion tinymce-single/blocks/elements/paragraph/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
} );

0 comments on commit 8848ab3

Please sign in to comment.