![]() |
#1 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,660
Karma: 29711016
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 |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
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 |
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,942
Karma: 60358908
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
|
![]() |
![]() |
![]() |
#5 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,428
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,601
Karma: 5703586
Join Date: Nov 2009
Device: many
|
No, it is the same gumbo-based parser the Calibre uses.
|
![]() |
![]() |
![]() |
#7 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,428
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,601
Karma: 5703586
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. |
![]() |
![]() |
![]() |
#9 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Also, see ==> Molly Bawn ![]() BR |
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
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.
|
![]() |
![]() |
![]() |
#11 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |