import { text } from './text.mjs';

/**
 * @typedef {import('../types.js').State} State
 * @typedef {import('../types.js').Parent} Parent
 * @typedef {import('../types.js').Raw} Raw
 */


/**
 * Serialize a raw node.
 *
 * @param {Raw} node
 *   Node to handle.
 * @param {number | undefined} index
 *   Index of `node` in `parent.
 * @param {Parent | undefined} parent
 *   Parent of `node`.
 * @param {State} state
 *   Info passed around about the current state.
 * @returns {string}
 *   Serialized node.
 */
function raw(node, index, parent, state) {
  return state.settings.allowDangerousHtml
    ? node.value
    : text(node, index, parent, state)
}

export { raw };
//# sourceMappingURL=raw.mjs.map
