From 73a7467cb48484ff25c0a4a544738f2bc235edd2 Mon Sep 17 00:00:00 2001 From: Edward <62042559+BeEdward@users.noreply.github.com> Date: Tue, 11 Jul 2023 07:24:02 -0700 Subject: [PATCH] Update src/shareon.js Use url encoded string to replace `#`. Co-authored-by: Nikita Karamov --- src/shareon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shareon.js b/src/shareon.js index d9c3f83..c15233d 100644 --- a/src/shareon.js +++ b/src/shareon.js @@ -17,7 +17,7 @@ import "./shareon.css"; * }) => string}} */ const urlBuilderMap = { - facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}${d.hashtags? `&hashtag=#${d.hashtags.split(',')[0]}` : ''}`, + facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}${d.hashtags? `&hashtag=%23${d.hashtags.split('%2C')[0]}` : ''}`, linkedin: (d) => `https://www.linkedin.com/sharing/share-offsite/?url=${d.url}`, mastodon: (d) => `https://toot.kytta.dev/?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}${d.via ? `%0D%0A%0D%0A${d.via}` : ''}`, messenger: (d) => `https://www.facebook.com/dialog/send?app_id=${d.fbAppId}&link=${d.url}&redirect_uri=${d.url}`,