Skip to content

Commit

Permalink
Ensure that class name with an empty string is never saved in the con…
Browse files Browse the repository at this point in the history
…tent
  • Loading branch information
gziolo committed Jul 29, 2019
1 parent ba14160 commit f0b8632
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ const RichTextContainer = compose( [
withFilters( 'experimentalRichText' ),
] )( RichTextWrapper );

RichTextContainer.Content = ( { value, tagName: Tag, multiline, ...props } ) => {
RichTextContainer.Content = ( { value, tagName: Tag, multiline, className, ...props } ) => {
let html = value;
let MultilineTag;

Expand All @@ -463,7 +463,7 @@ RichTextContainer.Content = ( { value, tagName: Tag, multiline, ...props } ) =>
const content = <RawHTML>{ html }</RawHTML>;

if ( Tag ) {
return <Tag { ...omit( props, [ 'format' ] ) }>{ content }</Tag>;
return <Tag className={ className || undefined } { ...omit( props, [ 'format' ] ) }>{ content }</Tag>;
}

return content;
Expand Down

0 comments on commit f0b8632

Please sign in to comment.