mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
15 lines
505 B
JavaScript
15 lines
505 B
JavaScript
const text = event.clipboardData.getData("text/plain");
|
|
const vscode = event.clipboardData.getData("vscode-editor-data");
|
|
const vscodeData = vscode ? JSON.parse(vscode) : undefined;
|
|
const language = vscodeData?.mode;
|
|
|
|
if (!text || !language) {
|
|
}
|
|
|
|
const { tr } = view.state;
|
|
|
|
const indent = detectIndentation(text);
|
|
|
|
// create an empty code block
|
|
tr.replaceSelectionWith(
|
|
); |