fix: Preserve hard breaks and paragraphs on paste

This commit is contained in:
iamsivin
2026-01-10 21:46:43 +05:30
parent ed9006f450
commit cbc4e0fa9b
3 changed files with 309 additions and 0 deletions
@@ -56,6 +56,8 @@ import {
calculateMenuPosition,
getEffectiveChannelType,
stripUnsupportedFormatting,
parseClipboardText,
serializeClipboardText,
} from 'dashboard/helper/editorHelper';
import {
hasPressedEnterAndNotCmdOrShift,
@@ -656,6 +658,8 @@ function createEditorView() {
editorView = new EditorView(editor.value, {
state: state,
editable: () => !props.disabled,
clipboardTextParser: parseClipboardText,
clipboardTextSerializer: serializeClipboardText,
dispatchTransaction: tx => {
state = state.apply(tx);
editorView.updateState(state);