From 420164c59a138385c448f1944512ab8c69f163c8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 4 Aug 2018 01:09:00 +0900 Subject: [PATCH] Trim text --- src/services/note/create.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 20dfc78c04..64556c160a 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -103,6 +103,10 @@ export default async (user: IUser, data: Option, silent = false) => new Promise< data.visibleUsers = data.visibleUsers.filter(x => x != null); } + if (data.text) { + data.text = data.text.trim(); + } + // Parse MFM const tokens = data.text ? parse(data.text) : [];