zestedesavoir / zmarkdown

Live demo: https://zestedesavoir.github.io/zmarkdown/
MIT License
226 stars 52 forks source link

Cannot set property 'sub_super' of undefined #438

Closed yCobanoglu closed 3 years ago

yCobanoglu commented 3 years ago
import unified from 'unified'
import remarkParse from 'remark-parse'
import remark2rehype from 'remark-rehype'
import stringify from 'rehype-stringify'
import remarkSubSuper from "remark-sub-super"

export default async function markdown2Html(markdown: string): Promise<string> {
  const file = await unified()
    .use(remarkParse)
    .use(remarkSubSuper)
    .use(remark2rehype)
    .use(stringify)
    .process(markdown)
  return String(file)
}

Throws the following typescript error. Screenshot_2021-06-07_18-15-27

wooorm commented 3 years ago

See https://github.com/zestedesavoir/zmarkdown/issues/416

StaloneLab commented 3 years ago

Closing as this was answered with further comments.

Feel free to reopen an issue if you need.