zero-md icon indicating copy to clipboard operation
zero-md copied to clipboard

github markdown emoji

Open losciur opened this issue 2 years ago • 1 comments

Hi, actually, github markdown emoji (https://gist.github.com/rxaviers/7360908) are not working for me.

Is it correct?

Do you think to add emoji in future release?

Thanks for you work!

losciur avatar Mar 07 '24 09:03 losciur

Use the marked-emoji extension.

<head>
  ...
  <script type="module">
    import ZeroMd from 'https://cdn.jsdelivr.net/npm/zero-md@next'
    import { markedEmoji } from 'https://cdn.jsdelivr.net/npm/marked-emoji@1/src/index.js'
    import { Octokit } from 'https://esm.sh/@octokit/rest'

    const octokit = new Octokit()
    const res = await octokit.rest.emojis.get()
    const emojis = res.data

    customElements.define(
      'zero-md',
      class extends ZeroMd {
        async load() {
          await super.load()
          this.marked.use(markedEmoji({ emojis, unicode: false }))
        }
      }
    )
  </script>
</head>
<body>
  ...
  <zero-md src="example.md></zero-md>
</body>

zerodevx avatar Mar 14 '24 13:03 zerodevx

Closing for now, feel free to reopen.

zerodevx avatar May 10 '24 08:05 zerodevx

Sorry I forgot to reply... all is working! Thanks!

losciur avatar May 13 '24 06:05 losciur