Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.2, 6.4.3, 6.5.3, dev
-
None
-
windows
Description
The Win 32 spec for CF_Html clearly states that the context (html and body tags) is optional and that StartHtml and EndHtml should be set to -1 in those cases.
See:
https://learn.microsoft.com/en-us/windows/win32/dataxchg/html-clipboard-format
QUOTE:
The context is optional, as sufficient information is included in the fragment for basic pasting of an HTML fragment to take place. If the context is not stored, the fragment only is stored and the StartHTML=EndHTML=-1.
But src/core/clipboard_util_win.cpp in CFHtmlExtractMetadata clearly does not handle the case where the find for <html comes back as not found, npos. That makes the search for StartFragment fail.
This causes the paste to not happen when the clipboard was created by outside copy that generates the cf_html according to the spec.
Perhaps something as simple as checking for '<html' not found, and instead looking for the first '<' after the metadata and calling that htmlstart for the purposes of the later substr call used in clipboard_qt that invokes CFHtmlExtractMetadata?
Attachments
Issue Links
- relates to
-
QTBUG-100806 QMimeData::html() returns undesirable meta data
-
- Closed
-
-
QTBUG-92539 Weird behavior when pasting certain HTML into element with contentEditable attribute set
-
- Closed
-