kjelsrud.dev/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js

28 lines
618 B
JavaScript
Raw Normal View History

2023-07-19 21:31:30 +02:00
/**
* @typedef {import('hast').Element} Element
* @typedef {import('mdast').Blockquote} Blockquote
* @typedef {import('../state.js').State} State
*/
/**
* Turn an mdast `blockquote` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Blockquote} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function blockquote(state, node) {
/** @type {Element} */
const result = {
type: 'element',
tagName: 'blockquote',
properties: {},
children: state.wrap(state.all(node), true)
}
state.patch(node, result)
return state.applyData(node, result)
}