File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -530,7 +530,7 @@ navigator.share = navigator.share || (function () {
530530 function bindEvents ( ) {
531531 Array . from ( container . querySelectorAll ( '.tool-icon' ) ) . forEach ( tool => {
532532 tool . addEventListener ( 'click' , event => {
533- const payload = text + ': ' + url ;
533+ const payload = encodeURIComponent ( text + ': ' + url ) ;
534534 switch ( tool . dataset . tool ) {
535535 case 'copy' : {
536536 navigator . clipboard . writeText ( url ) ;
@@ -583,15 +583,15 @@ navigator.share = navigator.share || (function () {
583583 break ;
584584 }
585585 case 'linkedin' : {
586- window . open ( `https://www.linkedin.com/shareArticle?mini=true&url=${ url } &title=${ title } &summary=${ text } &source=LinkedIn` ) ;
586+ window . open ( `https://www.linkedin.com/shareArticle?mini=true&url=${ encodeURIComponent ( url ) } &title=${ title } &summary=${ text } &source=LinkedIn` ) ;
587587 break ;
588588 }
589589 case 'telegram' : {
590- window . open ( ( isDesktop ? 'https://telegram.me/share/msg?url=' + url + '&text=' + encodeURIComponent ( text ) : 'tg://msg?text=' + payload ) ) ;
590+ window . open ( ( isDesktop ? 'https://telegram.me/share/msg?url=' + encodeURIComponent ( url ) + '&text=' + encodeURIComponent ( text ) : 'tg://msg?text=' + payload ) ) ;
591591 break ;
592592 }
593593 case 'pinterest' : {
594- window . open ( 'https://pinterest.com/pin/create/button/?url=' + url + '&description=' + encodeURIComponent ( text ) + '&media=' + image ) ;
594+ window . open ( 'https://pinterest.com/pin/create/button/?url=' + encodeURIComponent ( url ) + '&description=' + encodeURIComponent ( text ) + '&media=' + image ) ;
595595 break ;
596596 }
597597 }
You can’t perform that action at this time.
0 commit comments