site/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js

23 lines
557 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
/**
* @typedef {import('mdast').Paragraph} Paragraph
* @typedef {import('mdast').Parents} Parents
* @typedef {import('../types.js').Info} Info
* @typedef {import('../types.js').State} State
*/
/**
* @param {Paragraph} node
* @param {Parents | undefined} _
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function paragraph(node, _, state, info) {
const exit = state.enter('paragraph')
const subexit = state.enter('phrasing')
const value = state.containerPhrasing(node, info)
subexit()
exit()
return value
}