Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-09-2026, 03:52 PM   #1
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
Dealing with fragmented paragraphs after a .docx import

It's been a while since I worked with Sigil and in the past I was able to use search and replace to deal with:

<p>system to overcome the inherent disruptive tendencies of the</p>

<p>economic order. Others ascribe the conflict and confusion of the</p>

by pasting:

</p>

<p>

into the search field.

This no longer works. (I also tried the regex rule: <\/p>\s+<p> to no avail.)

Any help / work arounds would be appreciated.
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 03:55 PM   #2
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,333
Karma: 6686152
Join Date: Nov 2009
Device: many
You need to use regex and set the Regex flag to set DotAll true so that line ending new line chars are included.
KevinH is offline   Reply With Quote
Old 02-09-2026, 04:00 PM   #3
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
I checked the DotAll option and it is set.
Is my regex correct?
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 04:03 PM   #4
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
I'm using version 2.7.0 on an M3 Mac Mini with os 26.3
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 04:16 PM   #5
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,765
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
I would use...

Search - (\w)</p> <p>(\w)
Replace - \1 \2

Then you would need to run a second regex for the cases where punctuation precedes the </p> tag.
Karellen is offline   Reply With Quote
Old 02-09-2026, 04:22 PM   #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,333
Karma: 6686152
Join Date: Nov 2009
Device: many
Yes what Karellen said should work or even simpler (but maybe not smarter) you could use:

Find: </p>\s+<p>
and replace it with a single blank character.

But again you would have to use Regex mode and DotAll checked.
KevinH is offline   Reply With Quote
Old 02-09-2026, 06:09 PM   #7
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
So, I'm finding other search/replace oddities. Could it be a problem with my particular system settings? Could I have a Python issue, or environment variable issues?
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 06:13 PM   #8
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
Sadly, that didn't work.

Could I be having environment variable issues? (Or something along those lines?)
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 06:37 PM   #9
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,333
Karma: 6686152
Join Date: Nov 2009
Device: many
In what way didn't it work? I copied and pasted exactly what you posted as a test case into a new empty xhtml file in Sigil.

Open Search and Replace and typed exactly the following into Find field:
</p>\s+<p>

Then typed a single space into the Replace field.

I then set the search mode to Regex and made sure that DotAll was checked. Then I made sure my cursor was at the top of the page (since searching down) and hit the find button, then hit the replace button, and it properly merged your test-case paragraphs.

So either your test case is not representative of the actual code or something else is off.

It has nothing to do with environment vars or python as search uses neither.
KevinH is offline   Reply With Quote
Old 02-09-2026, 06:44 PM   #10
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
I moved the epub file to a windows machine and installed the latest Sigil there.
voila - it works.

So I'm gonna blame Apple unless someone here has the same hardware I do and it works for them.
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 06:46 PM   #11
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
Kevin - I just saw your post from 10:37 your time.

I don't know where to look as far as system settings on my machine.
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 06:57 PM   #12
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
I've attached the file I'm working on.
Is there anything about it that could be gumming up the works?
Attached Files
File Type: zip humanism.epub.zip (457.3 KB, 8 views)
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 07:13 PM   #13
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,333
Karma: 6686152
Join Date: Nov 2009
Device: many
Works on both my Macs. There is no platform specific code in Sigil's Search and Replace.
KevinH is offline   Reply With Quote
Old 02-09-2026, 07:15 PM   #14
MikeMaloney
Member
MikeMaloney began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
I have a separate Python installation that I use. Could that be interfering with Sigil?
MikeMaloney is offline   Reply With Quote
Old 02-09-2026, 07:16 PM   #15
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,333
Karma: 6686152
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by MikeMaloney View Post
Kevin - I just saw your post from 10:37 your time.

I don't know where to look as far as system settings on my machine.
What system settings? I am talking about how to use Find and Replace in Sigil, not system settings.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DOCX paragraphs listed as headings in navigation window tage fredheim Conversion 2 07-26-2019 08:11 AM
Import an HTML or DOCX file -|- Format? chaot Editor 1 05-19-2016 12:13 AM
conversion from docx to epub seems to break my paragraphs xanguera Conversion 2 07-24-2014 01:28 AM
Dealing with bad formatting: "broken" lines inside paragraphs? MelBr Calibre 5 08-26-2013 01:10 AM
Does Reader Memory Become Fragmented? Michele Sony Reader 2 11-05-2006 02:44 PM


All times are GMT -4. The time now is 07:16 AM.


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