mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Fix #2363 treat pasted HTML as image if a single <img> tag is the only content
This commit is contained in:
parent
bdf4873a31
commit
2b1e4495e2
1 changed files with 2 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ CKEDITOR.plugins.add('rx_paste', {
|
|||
const dataValue = event.data.dataValue;
|
||||
const dataTransfer = event.data.dataTransfer;
|
||||
const filesCount = dataTransfer.getFilesCount();
|
||||
const isFileTransfer = dataTransfer.isFileTransfer() || String(dataValue).match(/^<img\s[^>]+>$/);
|
||||
|
||||
// Replace iframe code in pasted text.
|
||||
if (method === 'paste' && dataValue && dataValue.replace) {
|
||||
|
|
@ -33,7 +34,7 @@ CKEDITOR.plugins.add('rx_paste', {
|
|||
}
|
||||
|
||||
// Check if the pasted data contains any files.
|
||||
if (filesCount && dataTransfer.isFileTransfer()) {
|
||||
if (filesCount && isFileTransfer) {
|
||||
event.stop();
|
||||
for (let i = 0; i < filesCount; i++) {
|
||||
uploadFile(dataTransfer.getFile(i));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue