Skip to content

Commit

Permalink
url encode
Browse files Browse the repository at this point in the history
  • Loading branch information
tubone24 committed Mar 15, 2024
1 parent 7801a94 commit 085f7ea
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/ShareBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ShareBox = ({
}) => (
<div className={style.mShareBox} role="application" data-testid="share-box">
<a
href={`https://www.facebook.com/sharer/sharer.php?u=${url}`}
href={`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(url)}`}
title="FacebookでShareする"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -63,7 +63,9 @@ const ShareBox = ({
<span className="icon-facebook" />
</a>
<a
href={`https://twitter.com/intent/tweet?text=LikeThis:&url=${url}`}
href={`https://twitter.com/intent/tweet?text=LikeThis:&url=${encodeURI(
url
)}`}
title="TwitterでShareする"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -79,7 +81,7 @@ const ShareBox = ({
<span className="icon-twitter" />
</a>
<a
href={`http://getpocket.com/edit?url=${url}`}
href={`http://getpocket.com/edit?url=${encodeURI(url)}`}
title="Pocketに追加する"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -95,7 +97,7 @@ const ShareBox = ({
<span className="icon-get-pocket" />
</a>
<a
href={`http://b.hatena.ne.jp/add?mode=confirm&url=${url}`}
href={`http://b.hatena.ne.jp/add?mode=confirm&url=${encodeURI(url)}`}
className={style.shareButtonNoBorder}
data-hatena-bookmark-layout="vertical-normal"
data-hatena-bookmark-lang="ja"
Expand Down

0 comments on commit 085f7ea

Please sign in to comment.