From 000f50863beb5463b4b23e81ef0c7106f12e612d Mon Sep 17 00:00:00 2001 From: zhou jing Date: Fri, 11 Aug 2023 01:50:31 +0800 Subject: [PATCH] fix: share to twitter get 400 Issue #881 (#887) --- src/components/common/ReactionShare.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/common/ReactionShare.tsx b/src/components/common/ReactionShare.tsx index cc63b3f4..1a086994 100644 --- a/src/components/common/ReactionShare.tsx +++ b/src/components/common/ReactionShare.tsx @@ -35,7 +35,9 @@ const shareList = [ ), onClick: (data: ShareData) => { window.open( - `https://twitter.com/intent/tweet?url=${data.url}&text=${data.text}&via=_xLog`, + `https://twitter.com/intent/tweet?url=${ + data.url + }&text=${encodeURIComponent(data.text)}&via=_xLog`, ) }, },