An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
// 共享编辑器引擎只在同步粘贴转换期间启用外部公式语法。
const withLatexMath = (lute: Lute, compatible: boolean, convert: () => string) => {
lute.SetLatexMath(compatible);
try {
return convert();
} finally {
lute.SetLatexMath(false);
}
};
export const markdownMathPaste = (lute: Lute, markdown: string, compatible: boolean, autoLink = false) =>
withLatexMath(lute, compatible, () => autoLink ? lute.Md2BlockDOMWithAutoLink(markdown) : lute.Md2BlockDOM(markdown));
export const htmlMathPaste = (lute: Lute, html: string, compatible: boolean) =>
withLatexMath(lute, compatible, () => lute.HTML2BlockDOM(html));