Note that the rehyphe-remark plugin doesn't generate the markdown, it transforms the HTML AST (hast) to a markdown AST (mdast).
The actual markdown is generated by the remark-stringify plugin which by default uses CommonMark (not GFM).
Markdown is serialized according to CommonMark
You can use the options to change the syntax of the markdown. For example, to use underscore for emphasized text (italic) instead of star you can set the emphasis
property to _
.
Here's their usage example.
import {unified} from 'unified'
import rehypeParse from 'rehype-parse'
import rehypeRemark from 'rehype-remark'
import remarkStringify from 'remark-stringify'
main()
async function main() {
const file = await unified()
.use(rehypeParse)
.use(rehypeRemark)
.use(remarkStringify, {
bullet: '*',
fence: '~',
fences: true,
incrementListMarker: false
})
.process('<h1>Hello, world!</h1>')
console.log(String(file))
}