mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[visual] Ignore files on the clipboard if the pasted HTML contains a table (#14817)
GitOrigin-RevId: 608a7a7cbe884243268322582873496bcde63305
This commit is contained in:
parent
f6e8f3a2a3
commit
08d8b40934
1 changed files with 6 additions and 5 deletions
|
@ -16,11 +16,6 @@ export const pasteHtml = [
|
|||
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
|
||||
|
@ -41,6 +36,12 @@ export const pasteHtml = [
|
|||
return false
|
||||
}
|
||||
|
||||
// allow pasting an image to create a figure, if the HTML doesn't contain a table
|
||||
// (because desktop Excel puts both an image and the HTML table on the clipboard)
|
||||
if (clipboardData.files.length > 0 && !html.includes('<table')) {
|
||||
return false
|
||||
}
|
||||
|
||||
// convert the HTML to LaTeX
|
||||
try {
|
||||
const parser = new DOMParser()
|
||||
|
|
Loading…
Reference in a new issue