Closed andrey-skl closed 9 months ago
Don't use code: true
on node types thar aren't code blocks. That should fix this.
@marijnh Thank you for your response!
As I see in our codebase, it was done intentionally to workaround some issues:
doc: {
code: true, // hack for https://github.com/ProseMirror/prosemirror-view/blob/5339e196f374a9ed2a6f1de85e3472b66fb8d844/src/clipboard.js#L44
content: 'paragraph',
},
paragraph: {
code: true, //hack for https://github.com/ProseMirror/prosemirror-view/blob/91af53423b55a725ecaf42d34329c7642d88285a/src/domchange.js#L42
content: 'inline*',
toDOM: () => ['p', 0],
},
I will check if the issues we tried to work around are still actual, thank you
Though I really do recommend not having code: true
where it doesn't make sense, there was a recent regression that was causing the HTML markup to be pasted like this. Attached patch should resolve that.
Note: maybe happened after this fix https://discuss.prosemirror.net/t/pasting-url-copied-from-ios-device-issues/5944/6
Expected: text is pasted as it was copied Actual: text is wrapped into meta-tags![2023-10-31 12 20 31](https://github.com/ProseMirror/prosemirror/assets/4318513/94aaa0ae-0a9e-48a1-8e39-d9e88b2b1c87)
<meta charset='utf-8'><p data-pm-slice="1 1 []">world</p>