05-06-2021, 04:21 AM | #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. |
05-06-2021, 07:22 AM | #2 |
null operator (he/him)
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 |
05-06-2021, 09:56 AM | #3 |
Wizard
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 |
05-06-2021, 10:32 AM | #4 |
Well trained by Cats
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
|
05-06-2021, 11:05 AM | #5 |
Resident Curmudgeon
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
|
|
05-06-2021, 11:13 AM | #6 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
No, it is the same gumbo-based parser the Calibre uses.
|
05-06-2021, 11:17 AM | #7 |
Resident Curmudgeon
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
|
|
05-06-2021, 11:27 AM | #8 |
Sigil Developer
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. |
05-06-2021, 05:49 PM | #9 | |
null operator (he/him)
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Also, see ==> Molly Bawn BR |
|
05-06-2021, 11:56 PM | #10 |
Grand Sorcerer
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.
|
05-09-2021, 09:12 PM | #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. |
|
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 |