2024-03-08
温故知新
00
请注意,本文编写于 215 天前,最后修改于 197 天前,其中某些信息可能已经过时。
javascript
import { marked } from 'marked' import { markedEmoji } from 'marked-emoji' import { Octokit } from '@octokit/rest' const showMarkdown = () => { let downDiv = document.getElementById('markdown-container') while (downDiv === null) { downDiv = document.getElementById('markdown-container') } emojiOptions().then((options) => { // emoji配置 marked.use(markedEmoji(options)) // 转html downDiv.innerHTML = marked.parse(pageStore.data, { emoji: true }) }) pageStore.loading = false } const emojiOptions = async () => { const octokit = new Octokit() // Get all the emojis available to use on GitHub. const res = await octokit.rest.emojis.get() const emojis = res.data return { emojis, unicode: false } }
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:DingDangDog

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!