|
|
#1 |
|
Member
![]() 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. |
|
|
|
|
|
#2 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#3 |
|
Member
![]() Posts: 21
Karma: 10
Join Date: Jan 2021
Device: iBooks
|
I checked the DotAll option and it is set.
Is my regex correct? |
|
|
|
|
|
#4 |
|
Member
![]() 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
|
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#6 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#7 |
|
Member
![]() 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?
|
|
|
|
|
|
#8 |
|
Member
![]() 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?) |
|
|
|
|
|
#9 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#10 |
|
Member
![]() 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. |
|
|
|
|
|
#11 |
|
Member
![]() 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. |
|
|
|
|
|
#12 |
|
Member
![]() 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? |
|
|
|
|
|
#13 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#14 |
|
Member
![]() 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?
|
|
|
|
|
|
#15 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,333
Karma: 6686152
Join Date: Nov 2009
Device: many
|
|
|
|
|
![]() |
|
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 |