Skip to content

Commit 8848ab3

Browse files
authored
Merge pull request #212 from WordPress/add/tinymce-single/insert
Adjust inserting for heading and paragraph
2 parents fdb5cf8 + d5350b4 commit 8848ab3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tinymce-single/blocks/elements/headings/register.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
type: 'text',
3434
icon: 'gridicons-heading',
3535
controls: getControls(),
36-
insert: function() {
37-
36+
insert: function( block, editor ) {
37+
// Maybe detect best heading based on document outline.
38+
editor.formatter.apply( 'h1', block );
3839
}
3940
} );
4041
} )( window.wp );

tinymce-single/blocks/elements/paragraph/register.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ window.wp.blocks.registerBlock( {
3434
'text-align-right'
3535
],
3636
insert: function( block, editor ) {
37-
editor.formatter.apply( 'paragraph', block );
37+
editor.formatter.apply( 'p', block );
3838
}
3939
} );

0 commit comments

Comments
 (0)