mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-24 01:23:08 +03:00
enable remark-gfm
This commit is contained in:
parent
72a3b92de3
commit
89e26cfc1d
@ -3,6 +3,7 @@ import * as React from "react";
|
||||
import unified from "unified";
|
||||
import parse from "remark-parse";
|
||||
import remark2react from "remark-react";
|
||||
import gfm from "remark-gfm";
|
||||
import linkifyRegex from "remark-linkify-regex";
|
||||
|
||||
export const Markdown = ({ md, options }) => {
|
||||
@ -11,6 +12,7 @@ export const Markdown = ({ md, options }) => {
|
||||
{
|
||||
unified()
|
||||
.use(parse)
|
||||
.use(gfm)
|
||||
.use(linkifyRegex(/@(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g)) // @user
|
||||
.use(linkifyRegex(/^(https?):\/\/[^\s$.?#].[^\s]*$/gm)) // http(s) links
|
||||
.use(remark2react, options)
|
||||
|
Loading…
Reference in New Issue
Block a user