Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-11-2023, 09:15 PM   #31
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 10-11-2023, 09:29 PM   #32
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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?
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2023-10-11 at 9.22.01 PM.png
Views:	32
Size:	77.8 KB
ID:	204244   Click image for larger version

Name:	Screenshot 2023-10-11 at 9.24.03 PM.png
Views:	32
Size:	230.4 KB
ID:	204245  

Last edited by KevinH; 10-11-2023 at 09:48 PM.
KevinH is offline   Reply With Quote
Advert
Old 10-11-2023, 09:42 PM   #33
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
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.
No rush. This may turn out to be something very strange.

Last edited by KevinH; 10-11-2023 at 09:47 PM.
KevinH is offline   Reply With Quote
Old 10-11-2023, 10:20 PM   #34
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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.
BetterRed is offline   Reply With Quote
Old 10-11-2023, 10:37 PM   #35
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Advert
Old 10-11-2023, 10:44 PM   #36
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
No rush. This may turn out to be something very strange.
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.

Click image for larger version

Name:	Screenshot 2023-10-12 133240.jpg
Views:	50
Size:	489.7 KB
ID:	204246

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
BetterRed is offline   Reply With Quote
Old 10-12-2023, 02:55 AM   #37
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
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.
Attached Thumbnails
Click image for larger version

Name:	2023-10-12.png
Views:	37
Size:	45.9 KB
ID:	204248  

Last edited by Leonatus; 10-12-2023 at 03:05 AM.
Leonatus is offline   Reply With Quote
Old 10-12-2023, 04:21 AM   #38
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Leonatus View Post
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.
Try copying the code from the calibre HTML Quelltext tab, of your Annotations column, directly into Sigil's Codeview window. You may have to tweak it, the code calibre wraps around the table doesn't seem to include grid lines etc.

I've lost sight of what you're trying to achieve; so, I'll go back and read your opening post.

BR
BetterRed is offline   Reply With Quote
Old 10-12-2023, 05:03 AM   #39
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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:
BetterRed is offline   Reply With Quote
Old 10-12-2023, 05:26 AM   #40
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Quote:
Originally Posted by BetterRed View Post
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.
Yes, that is what it's about. The issue was that in v.2.0 all formatting was left away when copying from the "Normal" View, whereas the previous version kept it. Copying it from the HTML-View works, as I reported. And yes, I have created an epub with the vocabulary, which is very comfortable to me!
Leonatus is offline   Reply With Quote
Old 10-12-2023, 05:45 AM   #41
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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
BetterRed is offline   Reply With Quote
Old 10-12-2023, 09:09 AM   #42
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by BetterRed View Post
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.

Attachment 204246

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
Thanks!

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?
KevinH is offline   Reply With Quote
Old 10-12-2023, 10:06 AM   #43
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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)
Not sure why anyone would want to simplify the html by removing tables. So copy in calibre creates two different formats, one html and the second a simplified html.

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.
KevinH is offline   Reply With Quote
Old 10-12-2023, 10:06 AM   #44
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
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.
Leonatus is offline   Reply With Quote
Old 10-12-2023, 11:29 AM   #45
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 02:21 PM.


MobileRead.com is a privately owned, operated and funded community.