Skip to content

Commit

Permalink
Add check to the merge function in headings and paragraph blocks (#13981
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 authored and youknowriad committed Mar 20, 2019
1 parent c2f63c1 commit 44a2579
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 44a2579

Please sign in to comment.