Skip to content

Commit ebdcb6c

Browse files
committed
Merge branch 'fix-mde-paste-image' into 'main'
MDE: fix pasted images not inserted in some cases See merge request reportcreator/reportcreator!1033
2 parents 0887c88 + 69da111 commit ebdcb6c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Upcoming
44
* Fix date field empty value not saved as null
5+
* Markdown editor: fix pasted images not inserted correctly in some cases
56

67

78
## v2025.69 - 2025-08-13

packages/frontend/src/composables/markdown.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,10 @@ export function useMarkdownEditorBase(options: {
361361

362362
const types = event.clipboardData?.types || [];
363363
if (types.includes('text/html') && (
364-
!types.includes('text/plain') || // HTML only
365-
types.indexOf('text/html') < types.indexOf('text/plain') || // Microsoft Excel, Word
366-
types.includes('text/rtf') // LibreOffice
364+
types.length === 1 || // HTML only
365+
(types.indexOf('text/html') === 0 && !types.includes('Files')) || // HTML content
366+
(types.indexOf('text/html') < types.indexOf('text/plain') && types.length === 2) || // Microsoft Excel, Word
367+
types.includes('text/rtf') // LibreOffice
367368
)) {
368369
event.stopPropagation();
369370
event.preventDefault();

0 commit comments

Comments
 (0)