Autolinker.js icon indicating copy to clipboard operation
Autolinker.js copied to clipboard

Support scheme url starting with emoji

Open caiofct opened this issue 1 year ago • 4 comments

This PR is a fix for https://github.com/gregjacobs/Autolinker.js/issues/399. It essentially allows a schema url to start with any char including an emoji.

caiofct avatar Jan 24 '24 12:01 caiofct

@gregjacobs This is the new PR. Sorry about the trouble.

caiofct avatar Jan 24 '24 12:01 caiofct

@gregjacobs Any chance you could take a look at this one soon? Really appreciate if we could merge this and get a new version out so we could use the new version in our apps. Let me know if you need anything from me.

caiofct avatar Jan 25 '24 16:01 caiofct

Hey @caiofct. Sorry for the delay.

Unfortunately I don't think this is the correct fix (although it works at the moment, unexpectedly 😄 ). I'm looking more into it now though.

We don't want to conceptually allow emojis to be valid scheme characters because a scheme (like http or https) would always be only ascii letters or numbers. I think instead, when we encounter an emoji, we want to skip over it and put the state machine back into the "no match" state. I'll play with it a bit.

Best, Greg

gregjacobs avatar Jan 29 '24 02:01 gregjacobs

Hey @gregjacobs any luck on this issue?

Hey @caiofct. Sorry for the delay.

Unfortunately I don't think this is the correct fix (although it works at the moment, unexpectedly 😄 ). I'm looking more into it now though.

We don't want to conceptually allow emojis to be valid scheme characters because a scheme (like http or https) would always be only ascii letters or numbers. I think instead, when we encounter an emoji, we want to skip over it and put the state machine back into the "no match" state. I'll play with it a bit.

Best, Greg

caiofct avatar Feb 26 '24 12:02 caiofct