paragraph.js 467 B

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