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-10-2025, 07:45 AM   #1
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 296
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Unexpected positioning of cursor in CV

Working in Sigil 2.6.2 Qt 6.8.2 in Linux using the AppImage

I've just converted a LibreOffice Writer .odt file to epub3 using the ODTImportQt plugin v0.5.0. All seemed to go pretty well but subsequent editing produced two (so far) unexpected problems.

1. When editing an xhtml file in the Code View, clicking in the Preview places the focus in CV in the paragraph below the one clicked in. If I want to edit an H2 or H3 heading between two paragraphs, I have to click in Preview in the paragraph above the heading. This is systematic in all paragraphs, headings etc.

2. a Ctrl click on the HTML tag while editing does not open the styles sheet at the appropriate entry. Even if the style sheet is already open, the Ctrl click in CV does nothing.

These two unexpected behaviours are strictly limited to the newly produced epub3 file using ODTImportQt so I suspect the plugin. Does it sound like a Qt issue?

Any ideas?
philja is offline   Reply With Quote
Old 10-10-2025, 08:16 AM   #2
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: 28,835
Karma: 207000000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It could just be something to do with the markup that is produced by LibreOffice. I don't believe the ODTImport plugin has much control over that--as it's primarily just a wrapper around the pre-existing Writer2xhtml tool.

Some code snippets from where you believe your cursor should be going in Code View might be helpful to tell what might be going on.

I might suspect the AppImage, but you mentioned that the problem is limited to one particular epub3.

Last edited by DiapDealer; 10-10-2025 at 08:35 AM.
DiapDealer is online now   Reply With Quote
Advert
Old 10-10-2025, 09:26 AM   #3
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 296
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
I've attached a code snippet from CV. You'll see the focus is on line 26 but in Preview I clicked exactly on the <h3> text. If the paragraphs are larger blocks of text, it doesn't matter where I click in Preview, the focus always goes in CV to the next paragraph.

I'm afraid there's nothing to see in the code snippet.

The original was written in Scrivener, and I've had problems before exporting from that software so I export as RTF and then copied and pasted into LibreOffice Writer section by section as plain text (Shft+Ctrl+Alt+V) making sure that each Writer style was correctly applied to the document for each paragraph.

Each Writer style is mapped to the CSS style I want applied by edits in the plugin's config.xml file and this mapping has worked perfectly.

I've used this technique before with the earlier version of ODTImport_0.4.1.zip and never noticed these odd positioning problems nor the fact that a Crtl click on the HTML tag fails to open the style sheet.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20251010_151023.png
Views:	11
Size:	73.4 KB
ID:	218560  
philja is offline   Reply With Quote
Old 10-10-2025, 09:37 AM   #4
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: 28,835
Karma: 207000000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
No message in Sigil's status bar when trying to launch the css file with ctrl+click?

Any chance of seeing the very top of the xhtml file? Say from the xml declaration down to the opening body tag?
DiapDealer is online now   Reply With Quote
Old 10-10-2025, 09:39 AM   #5
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: 9,037
Karma: 6361556
Join Date: Nov 2009
Device: many
The snippet won't help as any error is probably before it. These problems are typically caused by incorrect code in CV that is removed or fixed by the internal parser that is built into Preview.

So make a checkpoint then run Mend. Our gumbo parser should make a similar change to the incorrect code that will enable CV to sync properly with Preview again. You can use the checkpoint diff to see what was changed. Many times this is bare code in the body or unrecognized tags in the body that are removed by Preview or cause the html p adoption routine to run.

Last edited by KevinH; 10-10-2025 at 09:45 AM.
KevinH is online now   Reply With Quote
Advert
Old 10-10-2025, 12:04 PM   #6
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: 28,835
Karma: 207000000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I can confirm that running Mend is enough to restore order here. At first glance, I can see a few things that come straight out of writer2xhtml that Mend needs to fix:

1) No xml declaration at the top of the xhtml (possibly the cause of the one-line-off cursor problem when syncing)

2) The links to the css files are missing the type="text/css" attributes. This is definitely why CTRL+Click does not think there are any stylesheets to open.

3) Consecutive spaces from Writer2xhtml are converted to non-breaking space entities by Mend. If there are enough of them, it could account for cursor line mismatches when syncing from Preview to Code View too?

Last edited by DiapDealer; 10-10-2025 at 01:18 PM.
DiapDealer is online now   Reply With Quote
Old 10-10-2025, 02:12 PM   #7
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 296
Karma: 516
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Thanks Kevin and DiapDealer - you're spot on.

I did as Kevin suggested: made a checkpoint and then ran Mend. The epub is only small, 11 xhtml files. Every one had the same defects as shown in the attached screenshot: missing XML statement; missing type="text/css" on the stylesheet link.

Don't know about 'consecutive spaces' but the problem with opening the stylesheet with Ctrl click on an HTML tag has been remedied by the Mend and the Preview and CV are now perfectly aligned.

Curiously, the first thing I did after ODTImport produced the epub file was to run the EpubCheck plugin. And I didn't get these problems with earlier versions of the plugin. (though that was a while ago).

This epub file still needs a load of remedial work and formatting issues - you see 'lang' is not defined and Ep[ubCheck doesn't care.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20251010_195931.png
Views:	8
Size:	170.8 KB
ID:	218563  

Last edited by philja; 10-10-2025 at 02:15 PM.
philja is offline   Reply With Quote
Old 10-10-2025, 04:38 PM   #8
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: 9,037
Karma: 6361556
Join Date: Nov 2009
Device: many
Mend is really safe to use. I highly recommend setting your Preferences to Mend on Open and Mend before close. Mend does exactly the same thing as Preview and Web browsers do internally, so the final consumer of your epub is going to only see the the epub as parsed by its parser, so you probably want to see and work with the same thing in the code.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning TOC panel weberr Sigil 12 11-23-2014 03:38 PM
PDF page number positioning TheOldFellow Conversion 2 11-10-2014 04:02 PM
Chapter Positioning JaBagCali598 Conversion 2 03-27-2012 12:46 PM
Problem: positioning text to the bottom-right JulienDym ePub 5 07-06-2011 09:03 AM
Positioning cursor in K3 web browser tomsem Amazon Kindle 1 12-08-2010 03:20 PM


All times are GMT -4. The time now is 04:46 PM.


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