UNPKG

@bothub-chat/ui

Version:

Bothub UI Components

2 lines (1 loc) 539 B
export{default as remarkMath}from"remark-math";export{default as rehypeKatex}from"rehype-katex";import"katex/dist/katex.min.css";const e=()=>e=>{const t=e=>{const{children:o}=e;for(let e=0;e<o.length;e++){const t=o[e];if("html"!==t.type||"<cite>"!==t.value.toLowerCase())continue;const a=o.findIndex((t,o)=>o>e&&"html"===t.type&&"</cite>"===t.value.toLowerCase());if(-1===a)continue;const c={type:"cite",children:o.slice(e+1,a),data:{hName:"cite"}};o.splice(e,a-e+1,c)}for(const e of o)"children"in e&&t(e)};t(e)};export{e as remarkCite};