paragraph.js 557 B

12345678910111213141516171819202122
  1. /**
  2. * @typedef {import('mdast').Paragraph} Paragraph
  3. * @typedef {import('mdast').Parents} Parents
  4. * @typedef {import('../types.js').Info} Info
  5. * @typedef {import('../types.js').State} State
  6. */
  7. /**
  8. * @param {Paragraph} node
  9. * @param {Parents | undefined} _
  10. * @param {State} state
  11. * @param {Info} info
  12. * @returns {string}
  13. */
  14. export function paragraph(node, _, state, info) {
  15. const exit = state.enter('paragraph')
  16. const subexit = state.enter('phrasing')
  17. const value = state.containerPhrasing(node, info)
  18. subexit()
  19. exit()
  20. return value
  21. }