remarkjs / remark-gemoji

plugin to turn gemoji shortcodes into emoji 👍
https://remark.js.org
MIT License
44 stars 4 forks source link

Emoji not rendering #9

Closed elsaulio closed 4 years ago

elsaulio commented 4 years ago

Im trying to render emoji with remark-gemoji but it doesn't work, if i use remark-gemoji-to-emoji it works but it's from 2017 and uses gemoji 4, maybe i'm wrong expecting behaviour like remark-gemoji-to-emoji or retext-emoji

My code

import unified from 'unified'
import markdown from 'remark-parse'
import math from 'remark-math'
import remark2rehype from 'remark-rehype'
import katex from 'rehype-katex'
import rehype2react from 'rehype-react'
const gemoji = require('remark-gemoji')

let processor = unified()
    .use(markdown, { pedantic: false })
    .use(gemoji)
    .use(math)
    .use(remark2rehype)
    .use(katex)
    .use(rehype2react, { createElement: React.createElement })

export const HtmlRehypeCell: React.FC<{ content: string }> = ({ content }) => {
    return (
        <div >
            {processor.processSync(content).result as ReactElement}
        </div>
    )
}

if i use remark-gemoji-to-emoji then emoji shows and it's ok

wooorm commented 4 years ago

Hi there!

It’s understandable, but the readme specifies with an example what this plugin does and that it’s different from what you’re expecting here.

The list of related projects includes suggestions that achieve what you do what you want. That some of them are outdated may be better reporter in their repos.