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

Convert quill-emoji to html #37

Closed
PostMidnight opened this issue Oct 9, 2018 · 7 comments
Closed

Convert quill-emoji to html #37

PostMidnight opened this issue Oct 9, 2018 · 7 comments

Comments

@PostMidnight
Copy link

Hello,
I am new to this project so kindly excuse my complete ignorance.
I am trying to integrate quill into a forum, To that end I need to render quill's delta without an editor.
I tried using quill-delta-to-html but the output of the converter is empty (when it hits emoji).
Is there something I am doing wrong?
Thank you in advance!
JJ.

@cwhite-connectfirst
Copy link
Collaborator

cwhite-connectfirst commented Oct 17, 2018

@PostMidnight can you try the latest version of quill-emoji and report back?

@PostMidnight
Copy link
Author

looking good, thank you!

@c0bra
Copy link

c0bra commented Nov 6, 2019

@PostMidnight did it work for you after updating or did you have to do something else? I'm experiencing your issue with version 0.1.7.

@PostMidnight
Copy link
Author

Hi @c0bra , the new emoji works well. Quill however may need further work. See the quill page for documented issues and potential solutions.

@PostMidnight
Copy link
Author

Hi @c0bra it did work for me, however take a look at the quill page there may be some other issues related to yours.

@c0bra
Copy link

c0bra commented Dec 9, 2019

So I had to go another route. I forked this repo and exported emoji-map.js as a named export.

Then I used the map to convert emoji names to unicode characters like so:

import { EmojiMap } from 'quill-emoji';

const emoji = 'smile';
const code = String.fromCodePoint(parseInt(EmojiMap[emoji].unicode, 16));

This has worked for me in sending SMS content, etc.

@kembly
Copy link

kembly commented Jan 1, 2020

So I had to go another route. I forked this repo and exported emoji-map.js as a named export.

Then I used the map to convert emoji names to unicode characters like so:

import { EmojiMap } from 'quill-emoji';

const emoji = 'smile';
const code = String.fromCodePoint(parseInt(EmojiMap[emoji].unicode, 16));

This has worked for me in sending SMS content, etc.

@c0bra, you can actually just get it from this package without forking: https://github.com/contentco/quill-emoji/blob/master/src/module-emoji.js

import QuillEmoji from 'quill-emoji';
const { ShortNameEmoji } = QuillEmoji;
console.log(ShortNameEmoji.DEFAULTS.emojiList);

You can then just re-implement their mapping in your own code:

const emojiMap = {};

emojiList.forEach((emojiListObject) => {
    emojiMap[emojiListObject.name] = emojiListObject;
});

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

4 participants