09-13-2023, 11:46 AM | #1 |
Groupie
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.
|
09-13-2023, 12:38 PM | #2 |
Bibliophagist
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. |
09-13-2023, 03:08 PM | #3 |
Resident Curmudgeon
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.
|
09-13-2023, 04:10 PM | #4 |
the rook, bossing Never.
Posts: 11,166
Karma: 85874891
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. |
09-13-2023, 06:35 PM | #5 |
Groupie
Posts: 156
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.
|
09-13-2023, 06:50 PM | #6 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
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.
|
|
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 |