xfy 644db48d17 fix(lint): 修复 Biome 检查错误
- mermaid-renderer/src/index.ts: import 与后续语句间补空行(organizeImports)
- tiptap-editor footnote.test.ts: 局部 unescape 重命名为 unescapeFootnote,
  避免遮蔽全局 restricted name(noShadowRestrictedNames)
2026-07-23 13:36:11 +08:00

13 lines
629 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 把 mermaid 包成 IIFE 全局 bundle。
//
// 关键vite IIFE + `export default X` 会产出 `window.MermaidRenderer.default = X`
// (多一层 .default。为避免 mermaid.ts 取值时纠结这一层,这里把 mermaid 对象
// 直接赋给 window.MermaidRenderer 作为构建时副作用,使 window.MermaidRenderer
// 本身即 mermaid APIinitialize/render
import mermaid from 'mermaid';
// 构建时副作用:把 mermaid 挂到全局。ES module 的顶层赋值会被 vite 保留。
(globalThis as unknown as { MermaidRenderer: typeof mermaid }).MermaidRenderer = mermaid;
export default mermaid;