31 lines
674 B
JavaScript
31 lines
674 B
JavaScript
|
/**
|
||
|
* @typedef {import('hast').Element} Element
|
||
|
* @typedef {import('mdast').Blockquote} Blockquote
|
||
|
* @typedef {import('../state.js').State} State
|
||
|
*/
|
||
|
|
||
|
// Make VS Code show references to the above types.
|
||
|
''
|
||
|
|
||
|
/**
|
||
|
* 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)
|
||
|
}
|