@md2docx/react-markdown
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) • 1.04 kB
JavaScript
var r=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var M=(t,n)=>{for(var o in n)r(t,o,{get:n[o],enumerable:!0})},m=(t,n,o,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of f(n))!l.call(t,s)&&s!==o&&r(t,s,{get:()=>n[s],enumerable:!(e=u(n,s))||e.enumerable});return t};var N=t=>m(r({},"__esModule",{value:!0}),t);var R={};M(R,{expectHastToExclude:()=>H,expectMdastToContain:()=>c,expectSingleMdastNode:()=>y});module.exports=N(R);function d(t){return"children"in t?[t,...t.children.flatMap(d)]:[t]}function i(t){return"children"in t?[t,...t.children.flatMap(i)]:[t]}function c(t,n,o){let s=d(t).some(a=>a.type===n);return o==null||o(s).toBe(!0),s}function H(t,n,o){let s=i(t).some(a=>a.type==="element"&&a.tagName===n);return o==null||o(s).toBe(!1),!s}function y(t,n,o){let s=d(t).filter(a=>a.type===n).length;return o==null||o(s).toBe(1),s===1}0&&(module.exports={expectHastToExclude,expectMdastToContain,expectSingleMdastNode});
;