twitter-text icon indicating copy to clipboard operation
twitter-text copied to clipboard

JS: autoLinkWithJson mutates one the json input param

Open timhaines opened this issue 9 years ago • 3 comments

The json parameter passed into autoLinkWithJSON gets mutated here: https://github.com/twitter/twitter-text/blob/master/js/twitter-text.js#L683

The means that if you have tweet text with emoji at the start, and some links / usernames after the emoji, and call autoLinkWithJSON with the text and entities twice, it'll give you a different result each time.

timhaines avatar Apr 20 '15 22:04 timhaines

Ok, I'm looking for a fix today, and am able to reproduce. Thanks.

My references: Emoji tweet example: https://twitter.com/wazatreee/status/586654259661250561 Original issue: https://github.com/twitter/twitter-text-js/pull/123

jakl avatar Apr 22 '15 19:04 jakl

Any idea when this will be resolve? My new project http://🍕💩.ws will be sending a lot of emoji links to Twitter.

ericnakagawa avatar Jul 12 '15 19:07 ericnakagawa

I'm also looking for a fix to this.

nikkaroraa avatar Jan 28 '21 06:01 nikkaroraa