10-13-2023, 07:57 AM | #61 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
I think your detective work is spot on. This probably has to do to the changes related to markdown support in calibre.
But as far as I can tell, the code Kovid wrote properly identifies the mimetypes of each data blob on the clipboard. Using Edit->Paste looks for html markup and if it finds it, it should use that but PageEdit 2.0 is being confused and it applies the text/markdown data blob and not the text/html data blob from the clipboard. The best I can do with Edit->Paste is test if text/html exists on the clipboard and remove other mimetypes and blobs from the clipboard if you say No to force pasting plain text. Please try regenerating the debug log file when saying No to the popup so I can better see what is going on. |
10-13-2023, 08:01 AM | #62 |
Grand Sorcerer
Posts: 27,895
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Probably a separate issue... but I've found that when launching PageEdit by itself (with no content) on Windows, the edit mode doesn't always seem to "take". There's no cursor ready to accept input. Pasting again (or switching to View mode and back to Edit) seems to remedy the problem. For the purposes of debugging the current paste issue, I'd recommend making sure you have a blinking cursor, and that typed text appears before performing the Edit->Paste. I've never seen answering "No" to the prompt fail when PageEdit is ready to accept input.
Last edited by DiapDealer; 10-13-2023 at 08:33 AM. |
Advert | |
|
10-13-2023, 08:13 AM | #63 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
And to add a new variable, based on BetterRed's detective work on markdown support, i was able to search qtbugs better and as it turns out WebEngine did make some windows specific changes related to their clipboard code:
https://codereview.qt-project.org/c/...ipboard_qt.cpp from this issue: https://bugreports.qt.io/browse/QTBUG-100806 which indicates that Window's requires both the html and body tags on html content so that pasting html actually works on Windows. The latest fragments from calibre do not include those pieces. Last edited by KevinH; 10-13-2023 at 08:18 AM. |
10-13-2023, 08:15 AM | #64 | |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Yes. Good point.
I have an empty xhtml file on my Desktop, and when testing pasting into PageEdit I always open the file in PageEdit first otherwise things could get wonky for pasting. Quote:
|
|
10-13-2023, 08:16 AM | #65 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
I wonder what exact versions of Qt calibre is using in it 6.14 vs 6.16/6.17 versions.
Can anyone tell me that? |
Advert | |
|
10-13-2023, 08:41 AM | #66 | |
Grand Sorcerer
Posts: 27,895
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
The sources.json file in the bypy folder of calibre's main github repo will tell you the various dependency versions used. I browsed the various tag trees and searched for qt in that file. Last edited by DiapDealer; 10-13-2023 at 08:43 AM. |
|
10-13-2023, 09:09 AM | #67 | |
null operator (he/him)
Posts: 20,928
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
All of my tests were done on the default 'empty' EPUB Sigil creates when its started with no arguments, and I started PE thus: Let me know if you want anything more. (e.g do tests in Safe mode to eliminate my third party gadgets) BR Last edited by BetterRed; 10-13-2023 at 09:12 AM. |
|
10-13-2023, 12:22 PM | #68 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
That debug.txt file will keep being added to every time PageEdit is run when that environment variable is set.
So there are many different debug.txt outputs mixed in that file. Unfortunately, too many to tell what is going on. So would you please delete debug.txt to clear it Then run the case of latest calibre and latest PageEdit (debug version). Saying no at the popup. Once complete rename debug.txt to broken.txt. That will effectively clear debug.txt. Then please try again with a working calibre version and our debug PageEdit, saying no at that popup and rename that debug,txt file to working.txt. Then please post both broken.txt and working.txt here. Thanks! Last edited by KevinH; 10-13-2023 at 03:45 PM. |
10-13-2023, 04:11 PM | #69 |
null operator (he/him)
Posts: 20,928
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Here you go.
BR |
10-13-2023, 04:32 PM | #70 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Thank you. That is exactly what I needed. The "broken" one has html code without the html and body tags that are required on Windows.
The "working" one clearly has the html and body tags needed on Windows. See the comments in this Qt bug report: https://bugreports.qt.io/browse/QTBUG-100806 So the problem is actually Window's specific and is caused by Qt changes in qclipboard code in the qtwebengine codebase in Qt 6.4 that should be fixed in Qt 6.5. The only workaround, I can think of is when the pop-up comes up and the user responds no to pasting plain text, we can use a quick regular expression to check for html and body tags in the html on the clipboard and create a new "fixed" clipboard entry overwriting the current clipboard so that things actually work for Window's users. That said, I think the entire problem will just go away when Kovid/Calibre moves to Qt 6.5.3. But I have no idea if or when that might happen. |
10-13-2023, 05:36 PM | #71 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Actually, the required fix is in Qt 6.4.2. So the issue is not Qt.
That means the issue is calibre. Looking at changes from calibre 6.14.1 to 6.15.0, my **guess** is the problem change is here: "Comments editor: When copying to clipboard, copy clean HTML rather than the junk Qt produces" See: https://github.com/kovidgoyal/calibr...3b85faf8057089 My **guess** is he cleaned up too much ... but ... Given the above, Sigil/PageEdit will probably not try to workaround this change. calibre users will have to workaround it by using an older PageEdit or some intermediate tool to fixup the html code on the clipboard. It is hard enough to workaround Qt bugs / unwanted changes, I do not want to start doing that for calibre as well. Last edited by KevinH; 10-13-2023 at 05:46 PM. |
10-13-2023, 06:57 PM | #72 |
null operator (he/him)
Posts: 20,928
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
... if I paste what I copy from the Normal view of the Comments editor in the latest calibre (6.28.1) into Word (or OneNote) I get a table. Ditto if I paste it into an online html editor such as this one:
The only app in which I am not seeing a table is PageEdit. Maybe someone could do a test with LO Writer on Windows. BR Last edited by BetterRed; 10-13-2023 at 07:07 PM. |
10-13-2023, 07:08 PM | #73 |
Grand Sorcerer
Posts: 27,895
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I get the sentiment, but it's not really fair comparing PageEdit to word processing apps (or even html editors). How many of the apps that it "works" on are based on QtWebEngine?
|
10-13-2023, 07:34 PM | #74 | |
null operator (he/him)
Posts: 20,928
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Is there somewhere I can see a list of Qt based applications. The other Qt apps I have (qtbittorrent and Malwarebytes) don't have any place to paste rich text from the clipboard. BR |
|
10-13-2023, 07:34 PM | #75 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
And it is only an issue on Windows because what is stored by calibre on Windows only does not meet the cf_html clipboard spec used/needed by Qt as it leaves out the html and body tags.
If a fix is needed, then shouldn't calibre be the one that produces the correct cf_html that Windows Qt apps relies on since calibre is a Qt app? Or perhaps Qt on Windows should be more forgiving of fragments that do not include the html and body tags for the context part of the cf_html spec? If on Windows copying a table from FireFox, Edge, Chrome, LibreOffice, Word, Sigil, etc and pasting it into PageEdit works then the issue really is a non-compliant clipboard implementation done by calibre and not that Qt should be more forgiving. If copying a table from those sources to PageEdit does not work, please include the debug txt output so we can see why. If other major apps besides calibre do not work with PageEdit on Windows and for similar reasons, then I will try a Windows specific workaround. Last edited by KevinH; 10-13-2023 at 07:39 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PageEdit-1.7.0 Released | DiapDealer | Sigil | 1 | 07-22-2021 11:44 AM |
PageEdit-1.5.0 Released | DiapDealer | Sigil | 1 | 03-19-2021 10:59 AM |
PageEdit-1.3.0 Released | DiapDealer | Sigil | 26 | 08-19-2020 04:22 PM |
PageEdit-1.2.0 Released | DiapDealer | Sigil | 13 | 04-02-2020 04:16 AM |
PageEdit-0.9.6 Released | DiapDealer | Sigil | 22 | 01-30-2020 09:00 PM |