(editor: { getMarkdown(): string; getHTML(): string; isEmpty: boolean })
| 44 | * to serialise certain node types. |
| 45 | */ |
| 46 | export function getEditorMarkdown(editor: { getMarkdown(): string; getHTML(): string; isEmpty: boolean }): string { |
| 47 | try { |
| 48 | const markdown = editor.getMarkdown() |
| 49 | if (markdown) return markdown |
| 50 | if (editor.isEmpty) return '' |
| 51 | return editor.getHTML() |
| 52 | } catch { |
| 53 | return editor.getHTML() |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // ── XML tag escape / unescape ────────────────────────────────────────────────── |
| 58 |
no outgoing calls
no test coverage detected