humhub / humhub-prosemirror

Other
17 stars 8 forks source link

Fix #155: Prosemirror - Emoji Support Broken #140

Closed serh-mosk closed 9 months ago

luke- commented 9 months ago

@serh-mosk Thanks for the fix.

Can you please give some information about the fix, e.g. it would be interesting for me why we need emojilib-legacy.json. Do we need this for backward compatibility? Is there a reason why new smilies also need the legacy json?

Maybe it makes sense to migrate all smilies instead of using a legacy layer.

serh-mosk commented 9 months ago

@luke- Yes, this is necessary for backwards compatibility. Since the old emoticon names have been used for a long time, it will probably be difficult to find and rename them in all posts. In the new collection of emoticons, 1135 emoticons have a different name. So I added the old collection and adapted it to the new one.

luke- commented 9 months ago

@serh-mosk Unfortunately I am an expert on the emoji topic, so here some more questions:

serh-mosk commented 9 months ago

@luke- Ok, this is my answers:

luke- commented 9 months ago

@serh-mosk Ok, thanks for the explanations. Then let's use your solution. At least for now.

Markdown content with emojis is not only output via Javascript, but also rendered on the server side, e.g. in emails / notifications.

PHP Renderer:


But in general, what are the reasons for not saving the Unicode in the database, e.g. 🕶️ instead of :sunglasses:?

I see the following advantages:

Disadvantages:

What do you think? Should we refactor this in future?

serh-mosk commented 9 months ago

@luke- I think the reason is that when someone writes a post, he doesn't know which unicode corresponds to this or that emotion, but he can definitely write it down in a short code (the name of an emoticon). Also, it would not be clear to us when, if it was not possible to display a smiley, we would see its unicode instead of its short name. We also need to keep in mind the possibility of supporting skin color types for some emoticons. I think this was one of the main reasons for changing the data structure of emojilib. Yes, we will most likely have to refactor the emojis when we add support for skin colors.

luke- commented 9 months ago

@luke- I think the reason is that when someone writes a post, he doesn't know which unicode corresponds to this or that emotion, but he can definitely write it down in a short code (the name of an emoticon).

We can still use the Emoji Chooser, the Emojilib and its codes. Just insert the Unicode instead of the Text Code.

Also, it would not be clear to us when, if it was not possible to display a smiley, we would see its unicode instead of its short name. We also need to keep in mind the possibility of supporting skin color types for some emoticons. I think this was one of the main reasons for changing the data structure of emojilib. Yes, we will most likely have to refactor the emojis when we add support for skin colors.

Okay, that's right. Perhaps we can make a change in relation of this expansion. I'll create a new issue for this and merge the current one.

Thank you