Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-22-2019, 09:46 AM   #1
jouka
Junior Member
jouka began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2019
Device: ehh
need help with sigil

so i have a ebook (epub) with over 1000 individual files in it. the problem im having is that not all of it is formatted properly, i have text that is not located within <p></p>. my question is is here a way to place all the non formatted text into <p></p> with out having to do it manually for each chapter

</head>
<body>
<h1>chapter 1</h1>
text
<p>text</p>
<p>text</p>
text
jouka is offline   Reply With Quote
Old 06-22-2019, 10:12 AM   #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: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
You could wrap everything inside the body tag with a "div" or "section" tag if that is more appropriate. Then you use regular expression find and replace to replace the opening body tag with the opening body tag followed by an opening div tag, and then replace the closing body tag with a closing div followed by the closing body tag.

Also why on earth does any ebook have 1000 chapters. Something must be very broken or it is a fixed layout with 1000 pages of text.
KevinH is offline   Reply With Quote
Old 06-22-2019, 10:26 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
First, lets be clear:
This is NOT a Sigil (or any other editor, caused problem).
This is a terrible ('Naked Text') ,coding issue. that can be fixed using a decent editor like Sigil

Code:
</head>
<body>
<h1>chapter 1</h1>
text
<p>text</p>
<p>text</p>
text
</p>   <<< I assume this is the second case
I would do 2 passes of fixes (lime, sky blue) in REGEX mode:
first:
Code:
  Looks for naked between a /H1 at the end of a line and a P tag at the start of a line 
Search: </h1>\s+(.+?)\s+<p>
Replace: <h1><p>\1</p> <p>
second: looks for naked between /P and P tags
Code:
Search: </p>\s+(.+?)\s+<p>
Replace: </p> <p>\1</p> <p>
Each looks for the closing tag BEFORE the naked text. And should stop when it finds the specified opening tag Note OTHER BLOCK TAGS before the specified opening tag., will trip this up. (<Div, H#, Blockquote>) USE EXTREME CARE if using a 'Replace all'

Last edited by theducks; 06-23-2019 at 10:43 AM. Reason: removed stray >
theducks is offline   Reply With Quote
Old 06-23-2019, 06:03 AM   #4
carmenchu
Groupie
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
Please,
Quote:
Originally Posted by theducks View Post
Code:
 Looks for naked between a /H1 at the end of a line and a P tag at the start of a line 
Search: </h1>\s+(.+?)\s+<p>
Replace: <h1><p>\1></p> <p>
shouldn't be
Code:
Search: </h1>\s+(.+?)\s+<p>
Replace: </h1> <p>\1</p> <p>
and
Quote:
Originally Posted by theducks View Post
second: looks for naked between /P and P tags
Code:
Search: </p>\s+(.+?)\s+<p>
Replace: </p> <p>\1></p> <p>
Code:
Search: </p>\s+(.+?)\s+<p>
Replace: </p> <p>\1</p> <p>
Have found the same faulty encoded books more than once...
carmenchu is offline   Reply With Quote
Old 06-23-2019, 10:42 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by carmenchu View Post
Please,

shouldn't be
Code:
Search: </h1>\s+(.+?)\s+<p>
Replace: </h1> <p>\1</p> <p>
and

Code:
Search: </p>\s+(.+?)\s+<p>
Replace: </p> <p>\1</p> <p>
Have found the same faulty encoded books more than once...
I made a typo , sorry
theducks is offline   Reply With Quote
Old 06-23-2019, 11:28 AM   #6
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Well, I enjoyed the first three sentences anyhow.
Notjohn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil Error Message: Book File Would Not Open in Sigil fkustaa Sigil 5 03-18-2017 12:54 AM
Sigil-0.8.900 released for testing - Wait for Sigil-0.8.901 KevinH Sigil 106 10-04-2015 10:41 AM
Sigil on Nook vs Sigil on Kobo vs Sigil on iBook rosshalde Sigil 12 11-13-2014 09:34 AM
Sigil 0.3.4 / Sigil 0.4.0 RC1 / Cover in Nook Color Bertrand Sigil 13 08-06-2011 04:06 AM
Sigil 0.3.4 / Problème CSS entre Sigil et iPad Grivels Software 10 07-03-2011 09:06 AM


All times are GMT -4. The time now is 10:49 PM.


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