The remark site has a link to an AST explorer for the output of remark - https://astexplorer.net/#/gist/0a92bbf654aca4fdfb3f139254cf0bad/ffe102014c188434c027e43661dbe6ec30042ee2
What I cannot find is how to do the parsing to AST - all the examples convert to HTML.
I have this code
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkGfm from 'remark-gfm' // git flavoured markdown
const content = `
# My header
This is my content
- abc
- def
`;
unified()
.use(remarkParse)
.use(remarkGfm)
.process('# Hi\n\n*Hello*, world!')
.then((file) => {
console.log(String(file))
})
But I am getting a couple of errors here that I do not know how to get around
[remark-gfm] Warning: please upgrade to remark 13 to use this plugin
file:///markdown/node_modules/unified/lib/index.js:520
throw new TypeError('Cannot `' + name + '` without `Compiler`')
^
TypeError: Cannot `process` without `Compiler`
remark-gfm
so I don't experience[remark-gfm] Warning: please upgrade to remark 13 to use this plugin
.remark-gfm
isn't necessary to accomplish the goal - as I understood it. – Creight