From 76a656bc5b77e329d66551d2d2c7660dd3c469da Mon Sep 17 00:00:00 2001 From: "maxime.io" Date: Mon, 7 Aug 2023 14:39:44 +0200 Subject: [PATCH] Fix suggested title " " spaces (#2037) * Fix imported title   spaces * Update src/shared/components/post/post-form.tsx Co-authored-by: SleeplessOne1917 * Fix lint issue --------- Co-authored-by: SleeplessOne1917 --- src/shared/components/post/post-form.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/components/post/post-form.tsx b/src/shared/components/post/post-form.tsx index 6c88628..7b37926 100644 --- a/src/shared/components/post/post-form.tsx +++ b/src/shared/components/post/post-form.tsx @@ -582,8 +582,10 @@ export class PostForm extends Component { case "loading": return ; case "success": { - const suggestedTitle = this.state.metadataRes.data.metadata.title; - + // Clean up the title of any extra whitespace and replace   with a space + const suggestedTitle = this.state.metadataRes.data.metadata.title + ?.trim() + .replace(/\s+/g, " "); return ( suggestedTitle && (