Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 05-06-2021, 04:21 AM   #1
Snodgrass
Member
Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.
 
Posts: 16
Karma: 500000
Join Date: May 2013
Device: kobo, nook
'Ragged' code!

I hope this is the correct place to ask the question.

After I've tidied up most formatting, I get lots of gaps between code and text. Something like:

<p class="chapter">


Chapter 6


</P>

... if you see what I mean.

Is there a simple search formula to clean up the gaps.

Thanks in advance,

Snod.
Snodgrass is offline   Reply With Quote
Old 05-06-2021, 07:22 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I use Tools->Beautify all files

I think the toolbar button has a flower icon.

BR
BetterRed is offline   Reply With Quote
Old 05-06-2021, 09:56 AM   #3
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
FWIW, I've found that Beautify leaves a lot of blank lines

I usually Replace \n{1,} with nothing and then Beautify (3 and 4 below)

Capture1 = Before Beautify
Capture2 = After Beautify, before Find and Replace

Capture3 = After Find/Replace
Capture4 = After Beautify

Maybe there's a Beautify option I don't know about
Attached Thumbnails
Click image for larger version

Name:	Capture1.JPG
Views:	165
Size:	53.6 KB
ID:	186976   Click image for larger version

Name:	Capture2.JPG
Views:	159
Size:	53.9 KB
ID:	186977   Click image for larger version

Name:	Capture3.JPG
Views:	160
Size:	44.5 KB
ID:	186978   Click image for larger version

Name:	Capture4.JPG
Views:	154
Size:	49.7 KB
ID:	186979  
phossler is offline   Reply With Quote
Old 05-06-2021, 10:32 AM   #4
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,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
FWIW I find Sigil (mend & pretify) does a lot better for this cleanup
theducks is offline   Reply With Quote
Old 05-06-2021, 11:05 AM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by theducks View Post
FWIW I find Sigil (mend & pretify) does a lot better for this cleanup
I just tested both Calibre and Sigil and Sigil pretifies better then Calibre. But will mending cause any issues?
JSWolf is offline   Reply With Quote
Old 05-06-2021, 11:13 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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
No, it is the same gumbo-based parser the Calibre uses.
KevinH is offline   Reply With Quote
Old 05-06-2021, 11:17 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by KevinH View Post
No, it is the same gumbo-based parser the Calibre uses.
Thanks. Given that it's the same parser, why are the beautify results different? Given the same code from the OP, Sigil beautifies it better then Calibre.
JSWolf is offline   Reply With Quote
Old 05-06-2021, 11:27 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: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
It is not the parser that serializes things. A parser just builds the dom-like node tree. Beautification comes from how you serialize the tree back to text / xhtml.

Gumbo like all browser parsers is a an automatic mend/repair parser. It can take horrible html junk code and still build a viable node tree using the official rules of html5+ whatwg parsing.
KevinH is offline   Reply With Quote
Old 05-06-2021, 05:49 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
FWIW I find Sigil (mend & prettify) does a lot better for this cleanup
If the OP had posed the question in the Sigil forum I would have said the same. But for me, calibre's beautify is good enough if that's where I happen to be.

Also, see ==> Molly Bawn

BR
BetterRed is offline   Reply With Quote
Old 05-06-2021, 11:56 PM   #10
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
For the example given, the results shown are what I would expect from the beautify in the calibre editor. It general, it doesn't touch the text within the tags. So, it doesn't remove extra whitespace like that show after the opening paragraph tag. On the occasions where I see it, I use find/replace to clean it up.
davidfor is offline   Reply With Quote
Old 05-09-2021, 09:12 PM   #11
Snodgrass
Member
Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.Snodgrass ought to be getting tired of karma fortunes by now.
 
Posts: 16
Karma: 500000
Join Date: May 2013
Device: kobo, nook
Many thanks to all.

I shall experiment with Sigil.

Happy masking and isolating,

Ol.
Snodgrass is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ragged right margins with epubs? lumpynose Onyx Boox 19 02-21-2021 12:24 PM
AZW3 justified - ragged right j.p.s Kindle Formats 6 02-10-2019 01:23 PM
Ragged right / space between paragraphs Oldpilot Sigil 5 11-11-2010 07:59 PM
Fully Justified or Ragged Edge? JoolsB General Discussions 44 09-23-2010 10:57 PM
Ragged right justification on K2 dwallbaum Amazon Kindle 18 05-20-2010 07:48 PM


All times are GMT -4. The time now is 05:00 PM.


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