Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion common/clipboard_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@
}
else
{
function _html_has_image(document) {
return "" === document.body.innerText.trim() && !!document.querySelector("img")
};
function _is_html_outputting_single_mage(htmlStr) {
var document = (new DOMParser).parseFromString(htmlStr, "text/html");
return _html_has_image(document)
};
var _clipboard = (e && e.clipboardData) ? e.clipboardData : window.clipboardData;
if (!_clipboard || !_clipboard.getData)
return false;
Expand All @@ -264,7 +271,7 @@
}

var _html_format = isDisableRawPaste ? "" : this.ClosureParams.getData("text/html");
if (_html_format && _html_format != "")
if (_html_format && _html_format != "" && !_is_html_outputting_single_mage(_html_format))
{
var nIndex = _html_format.indexOf("</html>");
if (-1 != nIndex)
Expand Down