Skip to content

Commit

Permalink
Specify text block defaultAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and youknowriad committed Apr 27, 2017
1 parent 56c57a7 commit 344e721
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion blocks/library/text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ registerBlock( 'core/text', {
content: children(),
},

defaultAttributes: {
content: <p />
},

controls: [
{
icon: 'editor-alignleft',
Expand Down Expand Up @@ -51,7 +55,7 @@ registerBlock( 'core/text', {
},

edit( { attributes, setAttributes, insertBlockAfter, focus, setFocus, mergeWithPrevious } ) {
const { content = <p />, align } = attributes;
const { content, align } = attributes;

return (
<Editable
Expand Down
6 changes: 3 additions & 3 deletions languages/gutenberg.pot
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ msgstr ""

#: blocks/library/image/index.js:41
#: blocks/library/list/index.js:25
#: blocks/library/text/index.js:23
#: blocks/library/text/index.js:27
msgid "Align left"
msgstr ""

#: blocks/library/image/index.js:47
#: blocks/library/list/index.js:33
#: blocks/library/text/index.js:31
#: blocks/library/text/index.js:35
msgid "Align center"
msgstr ""

#: blocks/library/image/index.js:53
#: blocks/library/list/index.js:41
#: blocks/library/text/index.js:39
#: blocks/library/text/index.js:43
msgid "Align right"
msgstr ""

Expand Down

0 comments on commit 344e721

Please sign in to comment.