mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-19 04:59:33 +01:00
editor: preserve all whitespaces while setting content (#1978)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
This commit is contained in:
@@ -115,7 +115,9 @@ export function useEditorController(update: () => void): EditorController {
|
||||
htmlContentRef.current = value;
|
||||
if (!editor) break;
|
||||
const { from, to } = editor.state.selection;
|
||||
editor?.commands.setContent(htmlContentRef.current, false);
|
||||
editor?.commands.setContent(htmlContentRef.current, false, {
|
||||
preserveWhitespace: "full"
|
||||
});
|
||||
editor.commands.setTextSelection({
|
||||
from,
|
||||
to
|
||||
|
||||
Reference in New Issue
Block a user