Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-06-2026, 08:46 AM   #151
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: 29,274
Karma: 211540138
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
All thoughts and comments welcome. I know it is a bit complicated but once set it should be very very flexible to match your preferred prettyprint style then it can be forgotten about.
Seems to work the way it was intended.

I'm curious why when right-clicking in Code View and choosing to Mend and Prettify the current file, the cursor always moves to the opening body tag?

To be clear: this happened in previous versions of Sigil as well (and I don't think it's a huge deal by any means). I just wondered if there's a reason behind it?
DiapDealer is online now   Reply With Quote
Old 04-06-2026, 09:19 AM   #152
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,528
Karma: 6774048
Join Date: Nov 2009
Device: many
Mend and Prettify both are based on parsing the complete xhtml file into its gumbo DOM tree of nodes and then serializing it back to xhtml following specific rules. So as a guess only ... when you prettify, you can change lines and add or remove chars, etc, so any character offset stored before we prettify will typically be wrong so maybe we just store the line?

Or maybe we try storing a webpath and hope to get close upon return?

Will have to check the code on that.
KevinH is offline   Reply With Quote
Old 04-06-2026, 03:57 PM   #153
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,528
Karma: 6774048
Join Date: Nov 2009
Device: many
Okay, I took a closer look at the gitee code to do prettyrint after spending hours updating its use of QRegExp (which was removed for Qt6 but still in Qt5 compat) to use QRegularExpression and getting it to compile it became clear it basically punts and never condenses any text no matter what.

That is not something I consider an actual prettyprint tool. It is more like a lint tool of some sort.

So imho it is not worth adding to Sigil either.

So we are have only one user controllable PrettyPrint option, not two.

So please give what is in master a try, and let me know if it does what you need.

Thanks.
KevinH is offline   Reply With Quote
Old 04-06-2026, 05:04 PM   #154
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,528
Karma: 6774048
Join Date: Nov 2009
Device: many
I am thinking of adding a safety check to our PrettyPrint which will walk all linked css files and internal xhtml style tags looking for the use of the white-space property with any value other than "normal" and refuse to prettyprint that file. FWIW, pre tags contents will properly not be condensed but not eveyone uses pre tags in their html.

Thoughts?

Update: This safer prettprint approach has now been pushed to master.

Last edited by KevinH; 04-08-2026 at 05:05 PM.
KevinH is offline   Reply With Quote
Old 04-08-2026, 05:04 PM   #155
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,528
Karma: 6774048
Join Date: Nov 2009
Device: many
I have also revisited the prettyprint code from that gitee sigil-modified site. I was able to extract and fix it to properly condense text. I will add create a plugin version of it (once translated to python) for people to try out as an alternative to our built in gumbo based prettyprinting.

Last edited by KevinH; 04-08-2026 at 05:07 PM.
KevinH is offline   Reply With Quote
Old 04-08-2026, 06:06 PM   #156
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 51,188
Karma: 179232776
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For anyone interested in testing the new code, here's a link to my compile of the latest code from Sigil's Github repository: Sigil-2.7.6-Windows-x64-Setup.exe.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestions for Sigil Improvements or New Features KevinH Sigil 241 03-02-2026 01:09 PM
Suggestions for Sigil Improvements or New Features KevinH Sigil 168 11-18-2025 12:23 PM
Ideas for New Improvements or Features KevinH Sigil 97 04-09-2025 09:45 AM
What Features or Tools does Sigil Still Need Yet? KevinH Sigil 175 03-06-2021 09:11 PM
Improvements/bugs/features dontcrash KOReader 10 10-23-2019 10:05 AM


All times are GMT -4. The time now is 08:23 AM.


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