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 09-13-2023, 11:46 AM   #1
fogice
Groupie
fogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of light
 
Posts: 156
Karma: 12092
Join Date: May 2014
Device: Kobo Libra 2
Fixing 'two spaces between sentences'?

Is there a quick option I can select in the Editor (or in Convert, or some other plugin) to replace all occurrences of two (or more) spaces together? Many online writers that I download with FancFicFare are prone to using two spaces between every sentence, which I find ugly to read on an ereader.
fogice is offline   Reply With Quote
Old 09-13-2023, 12:38 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,498
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You could try a search for one or more spaces following a punctuation mark and replace with the punctuation mark and a single space.

Something like '(\p{P})\s+' and '\1 ' removing the 's.
DNSB is offline   Reply With Quote
Old 09-13-2023, 03:08 PM   #3
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: 74,033
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Just search for two spaces and replace with a singe space.
JSWolf is offline   Reply With Quote
Old 09-13-2023, 04:10 PM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by JSWolf View Post
Just search for two spaces and replace with a singe space.
Yes, repeatedly for all, in case there are 2+ spaces on occasion.
There is no valid reason for more than one space ever, anywhere.
You can use regex to entirely delete a space at the start or end of a paragraph for entire file.
Quoth is offline   Reply With Quote
Old 09-13-2023, 06:35 PM   #5
fogice
Groupie
fogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of lightfogice is a glorious beacon of light
 
Posts: 156
Karma: 12092
Join Date: May 2014
Device: Kobo Libra 2
Quote:
Originally Posted by DNSB View Post
You could try a search for one or more spaces following a punctuation mark and replace with the punctuation mark and a single space.

Something like '(\p{P})\s+' and '\1 ' removing the 's.
Yup, that does it. Thanks. I was hoping there was a clickable option similar to "remove space between paragraphs" that I had overlooked, so I don't have to look this code up every time. I tried to learn regex once, but it didn't stick.
fogice is offline   Reply With Quote
Old 09-13-2023, 06:50 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by fogice View Post
Many online writers that I download with FancFicFare are prone to using two spaces between every sentence, which I find ugly to read on an ereader.
Unless they're non-breaking spaces or entities (or they have "whitespace: pre" css applied), you'd probably never see back to back spaces between sentences on an ereader. Consecutive whitespace characters are typically collapsed into one space in html renderers.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex expression to replace certain spaces with nonbreaking spaces Dashcroft Sigil 3 12-10-2022 08:01 PM
Split Sentences Tony21139 Conversion 1 02-09-2017 01:12 PM
sentences boniface198 Conversion 4 09-07-2011 07:25 AM
Fixing broken sentences. Vanguard3000 Sigil 18 01-23-2011 12:45 PM
Unutterably Silly Memorable FIRST SENTENCES - Only Yours, please Dr. Drib Lounge 431 02-13-2009 04:57 AM


All times are GMT -4. The time now is 08:06 AM.


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