mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Avoid handling pasted HTML if there are files on the clipboard (#14321)
GitOrigin-RevId: 8bb258545f1763bf511817665c89e6f948dc0f62
This commit is contained in:
parent
a55bb9c4b2
commit
975ea16317
1 changed files with 11 additions and 1 deletions
|
@ -6,7 +6,17 @@ export const pasteHtml = Prec.highest(
|
||||||
paste(event, view) {
|
paste(event, view) {
|
||||||
const { clipboardData } = event
|
const { clipboardData } = event
|
||||||
|
|
||||||
if (!clipboardData?.types.includes('text/html')) {
|
if (!clipboardData) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// allow pasting an image to create a figure
|
||||||
|
if (clipboardData.files.length > 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// only handle pasted HTML
|
||||||
|
if (!clipboardData.types.includes('text/html')) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue