10-11-2023, 09:15 PM | #31 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm temporarily busier than a one-armed wallpaper hanger, but I'll try to do some testing on Windows 10 when I get some time.
|
10-11-2023, 09:29 PM | #32 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Okay, I loaded your snippet into Sigil and copied the * to the * in Preview to the clipboard, then pasted this into the PageEdit (current one).
And I get this the first attached screen capture. (ie. it works) If I then use PageEdit's Inspector, I get the second attached screen capture showing the exact table I copied out of Sigil's Preview Window. So I can not recreate what you are seeing at all on macOS. But I am not testing with calibre as I no longer use calibre. So whatever is happening might be related to calibre as the same thing worked copying that bit out of Safari, FireFox, Chrome, and Sigil's Preview and pasting into PageEdit. I also just realized that I am testing with Qt 6.5.3 (our upcoming release). So perhaps this was a bug in Qt 6.5.2. I will go and grab the release version of PageEdit just to check. Update: It all just works even with the official PageEdit 2.0.0 release binary. @BetterRed, Please try using just Sigil and loading your table xhtml snippet and copying it out of Sigil's Preview and then pasting into PageEdit 2.0.0. What do you see? Last edited by KevinH; 10-11-2023 at 09:48 PM. |
Advert | |
|
10-11-2023, 09:42 PM | #33 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
No rush. This may turn out to be something very strange.
Last edited by KevinH; 10-11-2023 at 09:47 PM. |
10-11-2023, 10:20 PM | #34 |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
If I paste the table I copied from calibre (and pasted in PE versions 1.9.10 amd 2.0.0 ) into current versions of MS Word and Onenote I get a table.
I doubt it has anything to do with Windows versions. |
10-11-2023, 10:37 PM | #35 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Please try the pure Sigil/PageEdit test I requested above when you get a free moment and let me know what you see. If no table then that way I can recreate exactly what you are trying.
|
Advert | |
|
10-11-2023, 10:44 PM | #36 |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Indeed!
If I paste the 'transformed' code from calibre's HTML View into Sigil CV, copy the table from Sigil PV, and paste it into PE 2.0.0 it's fine. Seems it ONLY misbehaves when copying from calibre's Rich Text editor Normal (i.e. rendered) view into Page Edit 2.0.0. My guess is that that is what Leonatus does with his annotations - "Normal" is the default view (tab) in calibre's rich text editor. BR Last edited by BetterRed; 10-11-2023 at 10:47 PM. Reason: last sentence |
10-12-2023, 02:55 AM | #37 |
Wizard
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
I copied it to a Word document, and all formatting is maintained, just as it should be in PageEdit, even the soft-hyphens.
@BetterRed: How can I change the view in Calibre's rich text editor? Only to make it clear: I copy the annotations from the metadata field as shown in the image below. Edit2: Ah, sorry, now I understand what you mean. The point is that in the previous version of PageEdit copy/pasting from the "Normal" View did the same effect. Last edited by Leonatus; 10-12-2023 at 03:05 AM. |
10-12-2023, 04:21 AM | #38 | |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I've lost sight of what you're trying to achieve; so, I'll go back and read your opening post. BR |
|
10-12-2023, 05:03 AM | #39 |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
OK - I would probably consolidate the annotations into a note taking app rather than ebook format file.
But I assume you want to view it on an e-reader device hence your use of Sigil/Page Edit to edit an epub. For the time being just copy the code from your Annotations HTML tab, and paste it into directly into Sigil's codeview window. Which is what Becky suggested in post #8. PS: This thread may be of interest ==>> Exporting annotations from Viewer. BR Last edited by BetterRed; 10-12-2023 at 05:07 AM. Reason: add PS: |
10-12-2023, 05:26 AM | #40 | |
Wizard
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Quote:
|
|
10-12-2023, 05:45 AM | #41 |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I'm sure the Sigil devs will figure out what's changed between calibre and PE… once Doug has finished wallpapering his loo
Meanwhile, either stick with PE 1.9.10, or just copy the code from calibre's HTML tab into Sigil's code view window and forget PE. Anyway, I'm done until I see what the devs have to say tomorrow my time. BR |
10-12-2023, 09:09 AM | #42 | |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Quote:
So you get what I see too. So something as you say is ONLY strange when copying from calibre's Rich Text Editor's Normal view directly to PageEdit 2.0.0. very weird! I will have to write some code to dump all of the mime types for the data on the QClipboard as something must be adding a new or changed mime type. Does this happen with old versions of calibre and PageEdit 2.0.0 or only the most recent version? |
|
10-12-2023, 10:06 AM | #43 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
I am a little worried that this might be a calibre related issue. I searched the calibre github site for QMimedata usage and found the following code snippet that actually removes tables from html when copying text to the clipboard.
As I am unfamiliar with the calibre code base, I have no idea if this routine is being invoked at all when copying out of calibre's Normal view. Code:
def copy_all(text_browser): mf = getattr(text_browser, 'details', text_browser) c = QApplication.clipboard() md = QMimeData() html = mf.toHtml() md.setHtml(html) from html5_parser import parse from lxml import etree root = parse(html) tables = tuple(root.iterdescendants('table')) for tag in root.iterdescendants(('table', 'tr', 'tbody')): tag.tag = 'div' parent = root is_vertical = getattr(text_browser, 'vertical', True) if not is_vertical: parent = tables[1] for tag in parent.iterdescendants('td'): for child in tag.iterdescendants('br'): child.tag = 'span' child.text = '\ue000' tt = etree.tostring(tag, method='text', encoding='unicode') tag.tag = 'span' for child in tuple(tag): tag.remove(child) tag.text = tt.strip() if not is_vertical: for tag in root.iterdescendants('td'): tag.tag = 'div' for tag in root.iterdescendants('a'): tag.attrib.pop('href', None) from calibre.utils.html2text import html2text simplified_html = etree.tostring(root, encoding='unicode') txt = html2text(simplified_html, single_line_break=True).strip() txt = txt.replace('\ue000', '\n\t') if iswindows: txt = os.linesep.join(txt.splitlines()) # print(simplified_html) # print(txt) md.setText(txt) c.setMimeData(md) PageEdit on Windows seems to default to the latter one based on BetterRed's testing. I will create a debug PageEdit version to list and dump all of the formats in the QClipboard QMimedata when Edit->Paste is invoked just to verify. Last edited by KevinH; 10-12-2023 at 10:09 AM. |
10-12-2023, 10:06 AM | #44 |
Wizard
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Since I'm at the vocabulary for several weeks, I must have passed some versions of Calibre. And my last version of PageEdit was 1.7.0, so I can't speak for others.
The issue occurred from one day to the other, when I had installed version 2.0.0. |
10-12-2023, 11:29 AM | #45 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Understood, but it is calibre that is creating an entry on the clipboard with the table removed. So QWebEnginePage is choosing to paste that version instead of the one with the table. I will try looking only tor html and stripping out the text only (no table) version if an html entry exists.
|
|
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 |