(_: React.MouseEvent<HTMLElement>, newMode: EditorMode | null)
| 69 | }, [localValue, onConfirm]) |
| 70 | |
| 71 | const handleModeChange = (_: React.MouseEvent<HTMLElement>, newMode: EditorMode | null) => { |
| 72 | if (!newMode || newMode === mode) return |
| 73 | // When switching to Source, flush the editor's current state to markdown so the |
| 74 | // textarea shows markdown rather than a raw HTML string (Gap 3 fix — mirrors PR #6021). |
| 75 | if (newMode === 'source' && editorRef.current) { |
| 76 | setLocalValue(unescapeXmlTags(getEditorMarkdown(editorRef.current))) |
| 77 | } |
| 78 | setMode(newMode) |
| 79 | } |
| 80 | |
| 81 | const isRichText = inputType === 'string' |
| 82 |
nothing calls this directly
no test coverage detected