tiptap: add debug console

This commit is contained in:
fantasticit 2022-06-17 22:16:14 +08:00
parent fea52025fe
commit b8f174f482
1 changed files with 14 additions and 0 deletions

View File

@ -83,6 +83,20 @@ export const Paste = Extension.create<IPasteOptions>({
const markdownText = event.clipboardData.getData('text/markdown'); const markdownText = event.clipboardData.getData('text/markdown');
const { state, dispatch } = view; const { state, dispatch } = view;
if (typeof window !== 'undefined') {
if (window.location.search.includes('dev=1')) {
console.group();
console.log('paste', {
text,
vscode,
node,
markdownText,
});
console.log(html);
console.groupEnd();
}
}
const { markdownToProsemirror } = extensionThis.options; const { markdownToProsemirror } = extensionThis.options;
// 直接复制节点 // 直接复制节点