1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes #8317: Removing Markdown when using 'Paste as Text' (#8351)

This commit is contained in:
pedr 2023-06-26 08:00:47 -03:00 committed by GitHub
parent 35a4eef87b
commit 583ae0385b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1106,7 +1106,12 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
}
function onPasteAsText() {
pasteAsPlainText(null);
// clipboard.readText returns Markdown instead of text when copying content from
// the Rich Text Editor. When the user "Paste as text" he does not expect to see
// anything besides text, that is why we are stripping here before pasting
// https://github.com/laurent22/joplin/pull/8351
const clipboardWithoutMarkdown = stripMarkup(MarkupToHtml.MARKUP_LANGUAGE_MARKDOWN, clipboard.readText());
pasteAsPlainText(clipboardWithoutMarkdown);
}
editor.on(TinyMceEditorEvents.KeyUp, onKeyUp);