|
|
#16 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#17 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
| Advert | |
|
|
|
|
#18 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#19 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
![]() |
|
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 |