From c303e00b278df31bec76add41a619ee353305aca 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 64313579..94fbecfa 100644 --- a/src/shared/components/post/post-form.tsx +++ b/src/shared/components/post/post-form.tsx @@ -581,8 +581,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 && (