Microsoft/monaco-editor
View on GitHub[Bug] Copy/pasting multiline content with key:value format in Safari loses line breaks
Open
#3969 opened on May 22, 2023
bugeditor-corehelp wanted
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `key: thing
otherkey: stuff
foo: bar
key : thing
otherkey : stuff
foo : bar
---
key: thing
otherkey: stuff
foo: bar
`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "yaml",
automaticLayout: true,
});
Reproduction Steps
In Safari on MacOS, select multiple lines of text which are of the format key: value, and then paste in a plain text setting, e.g. VSCode, TextEdit, etc. Observe that the text is pasted without line endings - i.e. all on one line.
Note: If pasting into a rich text setting such as Notes app or another Monaco Editor then line endings are correctly preserved.
Actual (Problematic) Behavior
Text is pasted without line breaks.
https://github.com/microsoft/monaco-editor/assets/1550045/404a2e30-595c-47a1-b492-a931526ae516
Expected Behavior
Text is pasted with line breaks in tact.
Additional Context
Safari: Version 16.4 (18615.1.26.110.1) MacOS: 13.3.1 (a)