mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-24 17:44:50 +03:00
enable remark-emoji
This commit is contained in:
parent
55b6c81722
commit
2a7b68cd65
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user