import type { Root } from 'hast'; import type { Transformer } from 'unified'; /** * Rehype plugin that flattens paragraph elements that are adjacent to lists in table cells. * * When markdown content is parsed inside JSX table cells, text before/after lists * gets wrapped in `
` tags. This causes unwanted spacing because both `
` and * list elements have margins. * * This plugin selectively unwraps only `
` elements that are immediately before * or after a list (`