Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-02-2026, 08:15 PM   #1
byword
Member
byword began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2022
Device: Onyx Leaf 3
Mend and Prettify frequently fails to run after splitting a file in v2.8.0

While editing a book, I have frequently encountered an issue where the "Mend and Prettify" function does not execute. This behavior started occurring after upgrading to version 2.8.0, so I am reporting it as a potential bug.

Symptoms:
"Mend and Prettify" does not work (the tags are not cleaned up/formatted).

Sigil Version: 2.8.0

Steps to Reproduce (Context):

1. Have multiple XHTML files in the project.
2. Split a file at an arbitrary point using Ctrl+Enter.
3. Run "Mend and Prettify" in the newly split file, and the tag formatting/cleanup fails to apply.

This does not happen 100% of the time, but it occurs frequently during actual book editing. When I try to deliberately replicate the bug by creating a mock scenario and pressing Ctrl+Enter to split a file, it sometimes works normally. While I haven't figured out the exact, definitive steps to reproduce it consistently yet, I am reporting this since it happens so often in practice. I will provide additional details as soon as I identify the precise triggering conditions.
byword is offline   Reply With Quote
Old 07-02-2026, 08:34 PM   #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: 29,540
Karma: 212177546
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You're absolutely certain that there is something for Mend & Prettify to do when it appears nothing happens? I ask because Split relies pretty heavily on code already being well-formed before the split can be performed.

Curious what you have to do to get it to work again after it seemingly fails to work.

Last edited by DiapDealer; 07-02-2026 at 08:47 PM.
DiapDealer is offline   Reply With Quote
Advert
Old 07-02-2026, 10:56 PM   #3
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,750
Karma: 6774572
Join Date: Nov 2009
Device: many
Mend and Prettify will no longer make changes to any xhtml that uses the css white-space property or has a css file linked to it that uses the white-space property. This was turned on in Sigil 2.8.0 to prevent Prettify from condensing text that the css says should not be.

Instead of using css white-space, you can of course use the xhtml pre tag to mark text where whitespace should not be changed. Unlike css, the pre tag carries semantic information that can be important for Accessibility.

So please search both your xhtml and all linked css for any use of the white-space property. My guess is you will find it.

As a quick test, since style tags and style attributes directly in xhtml are rare directly, simply unlink your css file and try Mend and Prettify again. But be careful to save first as css white-space property must have been set for a reason and Mend and Prettify will condense newlines and other whitespace.

Last edited by KevinH; 07-02-2026 at 11:07 PM.
KevinH is online now   Reply With Quote
Old 07-03-2026, 12:53 AM   #4
byword
Member
byword began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2022
Device: Onyx Leaf 3
Please Check this video

I know exactly how Mend and Prettify works. This is not a case where nothing changes after the tags are cleaned up.

If you watch the video (the menus are in Korean), you'll see that Mend and Prettify does not reformat the code. However, if I close the XHTML tab, reopen it, and then run Mend and Prettify again, the code is formatted correctly.

I didn't use the CSS white-space property or the <pre> tag that KevinH mentioned.

It doesn't happen every time. Sometimes I perform the exact same split, edit the code, and then run Mend and Prettify, and it works as expected. However, in some cases, it behaves like it does in the video and doesn't reformat the code. Once it gets into this state, Mend and Prettify won't work until I close the tab and reopen it. Editing the code or switching to another tab and then coming back doesn't make any difference.

I haven't found a way to reproduce the issue 100% consistently yet, but it occurs frequently during normal editing. Once I figure out the exact steps to reproduce it, I'll share them with you.

Screen capture was blocked, so I recorded the video with my phone instead. The quality isn't great, but you should still be able to clearly see the issue.

Last edited by byword; 07-03-2026 at 01:11 AM.
byword is offline   Reply With Quote
Old 07-03-2026, 02:03 AM   #5
byword
Member
byword began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2022
Device: Onyx Leaf 3
Quote:
Originally Posted by DiapDealer View Post
You're absolutely certain that there is something for Mend & Prettify to do when it appears nothing happens? I ask because Split relies pretty heavily on code already being well-formed before the split can be performed.

Curious what you have to do to get it to work again after it seemingly fails to work.

I've uploaded a video showing the malfunction. Please see my reply.
byword is offline   Reply With Quote
Advert
Old 07-03-2026, 10:05 AM   #6
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,750
Karma: 6774572
Join Date: Nov 2009
Device: many
Okay, I can recreate this if the split piece does not need to create a new tab (ie. an old tab gets a new name). The Tab tells CodeView what its bookpath is and that only gets set once when the tab was first created.

I will look into why.

Last edited by KevinH; 07-03-2026 at 04:02 PM.
KevinH is online now   Reply With Quote
Old 07-03-2026, 10:56 AM   #7
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,750
Karma: 6774572
Join Date: Nov 2009
Device: many
Okay, here is a way to 100% recreate the problem.

1) open an empty epub
2) in Section0001.xhtml add the following snippet to the body:
Code:
<h1>title with extra newlines


and                spaces 
</h1>
3. While leaving that CV tab open rename the file in BookBrowser to Section0002.xhtml (or any other *new* name).

4. In CV, use its pop-up menu and try running Mend and Prettify from it

You should see no change (ie. the bug)
KevinH is online now   Reply With Quote
Old 07-03-2026, 11:03 AM   #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,750
Karma: 6774572
Join Date: Nov 2009
Device: many
This should now be fixed in master. Thank you for your bug report!
KevinH is online now   Reply With Quote
Old 07-03-2026, 03:51 PM   #9
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: 52,873
Karma: 180988374
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For anyone running Windows and interesting in testing this fix, you can get a copy of the installer from Sigil-2.8.1-Windows-x64-Setup.exe.
DNSB is offline   Reply With Quote
Old Today, 08:10 PM   #10
byword
Member
byword began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2022
Device: Onyx Leaf 3
Quote:
Originally Posted by KevinH View Post
This should now be fixed in master. Thank you for your bug report!
Thank you for the quick fix. I'll build it on Windows 11 and test it.
byword is offline   Reply With Quote
Old Today, 08:38 PM   #11
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,750
Karma: 6774572
Join Date: Nov 2009
Device: many
Or you can simply grab DNSB's build for Windows above. It has all the bug fixes since Sigil 2.8.0 (thus the updated version number to 2.8.1 which I set in case of a bug fix only follow-up release, which we simply have not decided upon yet.)

Last edited by KevinH; Today at 08:54 PM.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
add-tts-engine fails to run dlibke Plugins 2 05-04-2018 06:26 PM
Page breaks and file splitting 1v4n0 ePub 10 11-22-2013 05:13 PM
File splitting and endnotes links mtrahan ePub 11 05-01-2011 04:07 PM


All times are GMT -4. The time now is 09:12 PM.


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