UNPKG

@md2docx/jsx

Version:

A modern, SSR-friendly React Markdown renderer that preserves the MDAST tree for reuse (e.g., mdast2docx), supports full JSX children, unified plugins, and component overrides.

2 lines (1 loc) 531 B
import"./chunk-YEKQJ4YC.mjs";function e(t){return"children"in t?[t,...t.children.flatMap(e)]:[t]}function d(t){return"children"in t?[t,...t.children.flatMap(d)]:[t]}function i(t,a,o){let n=e(t).some(s=>s.type===a);return o==null||o(n).toBe(!0),n}function u(t,a,o){let n=d(t).some(s=>s.type==="element"&&s.tagName===a);return o==null||o(n).toBe(!1),!n}function f(t,a,o){let n=e(t).filter(s=>s.type===a).length;return o==null||o(n).toBe(1),n===1}export{u as expectHastToExclude,i as expectMdastToContain,f as expectSingleMdastNode};