fix mdast library conflict

This commit is contained in:
keyan 2023-07-25 13:59:07 -05:00
parent 4bfd021342
commit e09ea310cd
3 changed files with 2941 additions and 273 deletions

View File

@ -1,12 +1,12 @@
import { fromMarkdown } from 'mdast-util-from-markdown'
import { gfmFromMarkdown } from 'mdast-util-gfm'
import { visit } from 'unist-util-visit'
import gfm from 'remark-gfm'
import { gfm } from 'micromark-extension-gfm'
import { fromMarkdown } from 'mdast-util-from-markdown'
export function mdHas (md, test) {
if (!md) return []
const tree = fromMarkdown(md, {
extensions: [gfm],
extensions: [gfm()],
mdastExtensions: [gfmFromMarkdown()]
})
@ -22,10 +22,12 @@ export function mdHas (md, test) {
export function extractUrls (md) {
if (!md) return []
const tree = fromMarkdown(md, {
extensions: [gfm],
extensions: [gfm()],
mdastExtensions: [gfmFromMarkdown()]
})
console.log('tree', tree)
const urls = new Set()
visit(tree, ({ type }) => {
return type === 'link' || type === 'image'

3200
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
"acorn": "^8.10.0",
"ajv": "^8.12.0",
"async-retry": "^1.3.1",
"aws-sdk": "^2.1421.0",
"aws-sdk": "^2.1422.0",
"babel-plugin-inline-react-svg": "^2.0.2",
"bech32": "^2.0.0",
"bolt11": "^1.4.1",
@ -40,7 +40,9 @@
"mathjs": "^11.9.1",
"mdast-util-find-and-replace": "^3.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-gfm": "^3.0.0",
"mdast-util-to-string": "^4.0.0",
"micromark-extension-gfm": "^3.0.0",
"next": "^13.4.12",
"next-auth": "^3.29.10",
"next-plausible": "^3.10.1",