mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Add workaround for unwanted CF_HTML header when pasting on Windows
Fixes #1751 for now; hopefully we can roll this change back once 6.3.1 is out in 3-4 weeks.
This commit is contained in:
parent
3031219a34
commit
da0cbfec32
1 changed files with 4 additions and 0 deletions
|
@ -1346,6 +1346,10 @@ class EditorWebView(AnkiWebView):
|
|||
if not mime.hasHtml():
|
||||
return
|
||||
html = mime.html()
|
||||
if is_win and qtmajor == 6:
|
||||
# workaround Qt including CF_HTML header in clipboard
|
||||
# FIXME: remove after we switch to Qt 6.2.5/6.3.1+.
|
||||
html = re.sub(r"^Version:0.9(.|\r|\n)+?SourceURL:.*?\r\n", "", html)
|
||||
mime.setHtml(f"<!--anki-->{html}")
|
||||
aqt.mw.progress.timer(10, lambda: clip.setMimeData(mime), False, parent=self)
|
||||
|
||||
|
|
Loading…
Reference in a new issue