diff --git a/common/clipboard_base.js b/common/clipboard_base.js index 4b077d1a65..042ab7933c 100644 --- a/common/clipboard_base.js +++ b/common/clipboard_base.js @@ -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; @@ -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(""); if (-1 != nIndex)