/** Безопасное чтение HTML из TipTap/ProseMirror (StrictMode / destroy mid-flight). */
export function readTipTapHtmlSafe(editor: {
isDestroyed?: boolean;
getHTML: () => string;
} | null | undefined): string | null {
if (!editor || editor.isDestroyed) return null;
try {
return editor.getHTML();
} catch {
return null;
}
}