Files
site/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

28 lines
628 B
JavaScript

/**
* @import {Info, State} from 'mdast-util-to-markdown'
* @import {Paragraph, Parents} from 'mdast'
*/
/**
* Serialize a paragraph node.
*
* @param {Paragraph} node
* Node to serialize.
* @param {Parents | undefined} _
* Parent node.
* @param {State} state
* Info passed around.
* @param {Info} info
* Info on surrounding context.
* @returns {string}
* Serialized markdown.
*/
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
}