Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 11:23 PM   #16
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,966
Karma: 7518950
Join Date: Nov 2009
Device: many
I am confused. That was the point of the requested change for "Mend and Prettify", ie. that it check for well-formed before running it. It forces people to not run that command until after the source is well-formed. So just Mend or hand fixing until well formed, then running Prettify.

"Mend and Prettify" is actually not two different steps. It parses any xhtml using gumbo (whatwg) and the when serializing the DOM tree back to xhtml, it does the prettify part.

The actual name of the command indicates how it works (ie it runs the gumbo repair parser then when serializing it back it does the prettify part. Normally that is safe but as you saw it can cause issues when attributes are not properly quoted, and since Prettify changes whitespace wholesale, it can be a bit disruptive at times.

So Mend vs Mend and Prettify are two different commands that each first parse the xhtml using a repair/whatwg parser then just serialize the DOM tree in different ways. The latter has never been running Mend first then Prettify.

Last edited by KevinH; Today at 12:22 AM.
KevinH is offline   Reply With Quote
Old Today, 12:43 AM   #17
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: 54,043
Karma: 182150335
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I may have misunderstood but I was under the impression that Mend and Prettify ran mend and then prettify. By the evidence, Mend and Prettify does not run Mend and then Prettify and so it is useless to me. I ended up renaming the option to Prettify only since that change helps to remind me to run it only if the ePub does not need mending. I would suggest removing the Mend portion of the option and having only Prettify as the label. I also note that Mend & Prettify still has the P underlined and Mend has the M underlined as though there were keyboard shortcuts for them.
DNSB is offline   Reply With Quote
Advert
Old Today, 12:58 AM   #18
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,966
Karma: 7518950
Join Date: Nov 2009
Device: many
Mend and Prettify effectively still does a "mend" (ie parses using the whatwg gumbo parser) but if well-formed first the parser makes no changes, so just the serialization of the parsed DOM tree will make changes.

I am happy to rename Mend and Prettify with just Prettify, but the parsing step will still need to be done by gumbo. It is inherent in how Prettify is done.
KevinH is offline   Reply With Quote
Old Today, 02:55 AM   #19
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: 54,043
Karma: 182150335
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Since Mend & Prettify fails on a missing DOCTYPE in one file and makes no changes to any files, I really don't consider it as doing a mend. If I click on the Mend, the missing DOCTYPE is inserted and then Prettify (AKA Mend & Prettify) will work to prettify the ePub.

Basically to me, if Mend & Prettify will only work on a ePub that does not need mending, it is not Mend & Prettify, it is just Prettify with a longer name.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mend and Prettify frequently fails to run after splitting a file in v2.8.0 byword Sigil 10 07-05-2026 08:38 PM
Disappointed with 'Mend and Prettify' when <table>'s included. philja Sigil 9 12-11-2025 08:38 PM
About "Mend and Prettify Code" RbnJrg Sigil 1 10-06-2025 07:12 PM
Sigil Prettify Code iMilazzo Sigil 26 05-12-2025 10:09 AM
Prettify HTML questions n9qqk Sigil 13 03-06-2018 12:47 PM


All times are GMT -4. The time now is 04:24 AM.


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