enable remark-emoji

This commit is contained in:
Chris Waring 2020-11-20 18:20:47 +00:00
parent 55b6c81722
commit 2a7b68cd65
No known key found for this signature in database
GPG Key ID: 4D2E767CC8B1C083

View File

@ -4,6 +4,7 @@ import unified from "unified";
import parse from "remark-parse"; import parse from "remark-parse";
import remark2react from "remark-react"; import remark2react from "remark-react";
import gfm from "remark-gfm"; import gfm from "remark-gfm";
import emoji from "remark-emoji";
import linkifyRegex from "remark-linkify-regex"; import linkifyRegex from "remark-linkify-regex";
export const Markdown = ({ md, options }) => { export const Markdown = ({ md, options }) => {
@ -13,6 +14,7 @@ export const Markdown = ({ md, options }) => {
unified() unified()
.use(parse) .use(parse)
.use(gfm) .use(gfm)
.use(emoji)
.use(linkifyRegex(/@(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g)) // @user .use(linkifyRegex(/@(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g)) // @user
.use(linkifyRegex(/^(https?):\/\/[^\s$.?#].[^\s]*$/gm)) // http(s) links .use(linkifyRegex(/^(https?):\/\/[^\s$.?#].[^\s]*$/gm)) // http(s) links
.use(remark2react, options) .use(remark2react, options)