[site/utils][s]: removed unnecessary package
This commit is contained in:
parent
2baae59588
commit
df069f75c3
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"name": "web3",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{}
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
import { unified } from 'unified'
|
import { unified } from 'unified'
|
||||||
import remarkParse from 'remark-parse'
|
import remarkParse from 'remark-parse'
|
||||||
import find from 'unist-util-find'
|
|
||||||
import { toString } from 'mdast-util-to-string'
|
import { toString } from 'mdast-util-to-string'
|
||||||
|
|
||||||
|
|
||||||
// get first paragraph found in the document
|
// get first paragraph found in the document
|
||||||
const documentExtract = (md) => {
|
const documentExtract = (md) => {
|
||||||
const mdast = unified().use(remarkParse).parse(md);
|
const mdast = unified().use(remarkParse).parse(md);
|
||||||
let paragraph = find(mdast, (node) => node.type === "paragraph");
|
let paragraph = mdast.children.find((node) => node.type === "paragraph");
|
||||||
return toString(paragraph);
|
return toString(paragraph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue