Hi - Scrivener’s HTML clipboard is not being picked up in the major Chromium-based browsers in RC4.
This means that when we copy some text from our Scrivener pane and paste into Google Docs, we’ll lose or retain formatting depending on which browser we’re using. We’ll paste plain text if we’re using Chrome, Edge or Opera, and paste formatted text if we’re running Firefox. Same result when pasting into WordPress’s WYSIWYG editor, or that of any other content management system.
To test for yourself without firing up Docs or a CMS, try the public demos of these three javascript-based WYSIWYG editors. Nothing to download; they’re ready to go in your browser:
TinyMCE: tiny.cloud/docs/demo/basic-example/
CKEditor: ckeditor.com/ckeditor-4/demo/
Summernote: summernote.org/
Try copying some formatted text, bold, italic, colors, headers, from your Scrivener editing pane into these online editors using Firefox and using Chrome. Note that these editors apply some formatting filters of their own – much needed when pasting from Scrivener – so you may see bold but not colors when pasting in Firefox. But in Chrome you’ll see only plain text. I’m guessing the Chromium code is more stringent about the proper formatting of the clipboard, which can be painstaking.
The interesting middle case appears when using the browser in the QtWebEngine embedded in Scrivener itself. To do so, drag the links above into Bookmarks, and view each editor in one Scrivener editing pane while pasting formatted text from the other. Oh yeah, formatting is retained. But then what? When you copy from those editors out to your CMS, you’ll lose the formatting again, unless you actually maintain said CMS in that Scrivener web-rendering pane or in Firefox.
Moreover, at least one other QtWebEngine-based application has the same behavior: PageEdit 1.20, the editor under development as a standalone component of Sigil. It’ll cheerfully paste formatted text to and from Scrivener, from the above scripts loaded in Scrivener’s browser, and from Firefox. But pasting from PageEdit into Chrome will yield only plain text.
So this is a Qt problem. But Scrivener users will be experiencing and raising it.
As a workaround for those of us who would stick with our browser of choice, we can paste first into the Gecko-based editor BlueGriffon, or into an email in Thunderbird, then copy and paste on into Google Docs or our CMS.
I also have an AutoHotkey fix that uses a street-tweaked version of the WinClip tool originally developed, I believe, by Apathy Softworks. Using WinClip.ahk and WinClipAPI.ahk from this page:
autohotkey.com/boards/viewt … =6&t=29314
…with the tweaked version of GetHTML() from here:
autohotkey.com/boards/viewt … 22#p308322
Then subroutine be like:
ClpChr:
rawhtml := WinClip.GetHTML()
startpos := instr(rawhtml, "<!--StartFragment-->")
rawhtml := substr(rawhtml, startpos)
WinClip.Clear()
winClip.SetHTML(rawHTML)
Msgbox, HTML Clipboard patched by WinClip
Return
For experienced developers only! Maybe the script can help reveal the critical difference in the Chromium-incompatible clipboard.
Rgds - Jerome