Fix copy paste in rich editor
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -18,6 +18,10 @@ export const MarkdownPasteExtension = Extension.create({
|
|||||||
key: markdownPasteKey,
|
key: markdownPasteKey,
|
||||||
props: {
|
props: {
|
||||||
handlePaste(view, event) {
|
handlePaste(view, event) {
|
||||||
|
if (event.clipboardData?.getData("text/html")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const text = event.clipboardData?.getData("text/plain") ?? "";
|
const text = event.clipboardData?.getData("text/plain") ?? "";
|
||||||
if (!hasMarkdown(text)) {
|
if (!hasMarkdown(text)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user