Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for the Emoji Extension? #40

Open
bribar opened this issue Oct 4, 2023 · 1 comment
Open

Support for the Emoji Extension? #40

bribar opened this issue Oct 4, 2023 · 1 comment

Comments

@bribar
Copy link

bribar commented Oct 4, 2023

Is there any support to parse json to html for emoji nodes? Currently it just strips the emoji.

@bribar
Copy link
Author

bribar commented Nov 9, 2023

Here's a work around I came up with for my need...but would be nice if the library included something similar. I used this library for reference https://github.com/elvanto/litemoji/tree/master

$editor->descendants(function (&$node) {
       // Skip if not emoji
       if ($node->type !== 'emoji') {
             return;
       }
       // Change node to text and convert emoji shortcode
       $node->type = 'text';
       $node->text = LitEmoji::encodeUnicode(':'.$node->attrs->name.':');
});

Alternatively, one could extend the Node class similar to the Mention extension included in the Tiptap library for emojis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant