Skip to content

Commit

Permalink
Add check to the merge function in headings and paragraph blocks
Browse files Browse the repository at this point in the history
If trying to merge a blank heading or paragraph, if this check isn't performed,
the result is the string 'Null' appearing in the text.
  • Loading branch information
brentswisher committed Feb 27, 2019
1 parent ede3258 commit 3db51db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const settings = {

merge( attributes, attributesToMerge ) {
return {
content: attributes.content + attributesToMerge.content,
content: ( attributes.content || '' ) + ( attributesToMerge.content || '' ),
};
},

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/paragraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const settings = {

merge( attributes, attributesToMerge ) {
return {
content: attributes.content + attributesToMerge.content,
content: ( attributes.content || '' ) + ( attributesToMerge.content || '' ),
};
},

Expand Down

0 comments on commit 3db51db

Please sign in to comment.