Skip to content

Commit

Permalink
fix(RichTextEditor): add placeholder for empty markdown descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin-chaurasiya committed Dec 13, 2024
1 parent f1b1c1d commit 5f4b8d4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const RichTextEditorPreviewerV1: FC<PreviewerProp> = ({
setReadMore(Boolean(isDescriptionExpanded));
}, [isDescriptionExpanded]);

// if markdown is empty then show no description placeholder
if (markdown === '' || markdown === '<p></p>') {
return <span className="text-grey-muted">{t('label.no-description')}</span>;
}

return (
<div
className={classNames('rich-text-editor-container', className, {
Expand Down

0 comments on commit 5f4b8d4

Please sign in to comment.