question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Since 0.4.5, URLs are also converted into emojis

See original GitHub issue

This happens definitely since 0.4.5 (this PR).

import Emoji, { toArray } from 'react-emoji-render';

// Within the component render():

const text = "https://google.foo :)";
const values = [];
const items = toArray(text);
let idx = 0;

for (const item of items)
{
  values.push(
    <Emoji
      key={idx++}
      text={item.props.children}
      options={{ className: 'emoji' }}
    />
  );
}

return (
  <div>{values}</div>
);

This code is generating this:

https😕/google.foo 😃

As you can see, the :/ chars within the URL are also being converted into an emoji. Something tells me that it shouldn’t go so far.

I’m not sure what the solution should be, but IMHO it would make sense if the parser requires some space, tab, dot, comma or similar char before or after the matched emoji symbol.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
enzofereycommented, Sep 5, 2018

Yes sure, the thing is that doing so you are removing support of consecutive emojis like “😃😃”. I added this kind of support in v0.4.5 because imagine yourself writing a text and you want to automatically parse the text as you write. For example you write “hello” and then add “😃😛” (letter by letter obviously), the former “😛” wouldn’t get parsed.

I’m working on a solution that works for both cases right now, expect some news later in the day 👍

1reaction
ibccommented, Sep 25, 2018

Thanks guys, I confirm that it works great now in all cases I’ve tested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

404 error for the resource "/partytown/partytown-sandbox-sw ...
I recently tried integrating Partytown for my website Mustakbil.com but encountered this error #38 (comment).
Read more >
Improving sentiment analysis accuracy with emoji embedding
Emojis were also translated into corresponding sentiment words when constructing features for comparison with those directly generated from emoji label ...
Read more >
Autocorrect emojis in documents and email - Microsoft Support
See how to add emojis and turn AutoText emojis off. ... When you type :) or :-) in Word or Outlook, autocorrect converts...
Read more >
sopel-modules.github 0.4.8 - PyPI
Detects when GitHub URLs are posted and takes over URL handling of them, ... most :emoji_name: s will be converted to Unicode emoji...
Read more >
Change log - TweeseCake
Mastodon: You can now pick a server emoji to insert into your text! Mastodon: Show full server URL in mastodon session title.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found