![]() |
#1 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 162
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.
|
![]() |
![]() |
![]() |
#2 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37,057
Karma: 148321038
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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. |
![]() |
![]() |
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 74,753
Karma: 131375596
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.
|
![]() |
![]() |
![]() |
#4 |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,763
Karma: 87663463
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
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. |
![]() |
![]() |
![]() |
#5 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 162
Karma: 12092
Join Date: May 2014
Device: Kobo Libra 2
|
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.
|
![]() |
![]() |
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,634
Karma: 194783560
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |