![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
Odd S&R with non breaking space
Calibre 1.46 running on WindowsXP SR3.
I've got an epub where someone has hard-coded an indent at the start of each paragraph using four or five non breaking space characters. This is how they appear in the editor : Code:
<p>****** At last the office was clear again.</p> I want to change these to use a css class to provide the indent : Code:
<p class="indent">At last the office was clear again.</p> Code:
Search :<p>*{1,} Replace: <p class="indent"> If I then click on "Replace All" the replace is only applied to the current file so I have to work my way through seventy odd files to do the job. The same applies if I use Code:
Search : <p>\s{3,} BobC EDIT : I think I have solved this - the non-breaking spaces are coded as html entities. Until I open the individual file they are not converted to a form S&R can find. By running "fix HTML" on the book it converts them all and then the S&R appears to work. Found it by using Sigil to open the file and realised it was a html entity coding issue. Last edited by BobC; 07-29-2014 at 02:06 PM. Reason: Solved |
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You can also use
Code:
( )+ Or use Code:
(*| )+ (The plus and {1,} do exactly the same thing. opinion: plus is easier to read.) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
Constructing a search string isn't a problem - the problem I hit was recognising that what I could see when viewing the file (unicode non-breaking spaces) wasn't what was in unviewed files so wouldn't be found by an "all files" search. I must include "beautify all files" in my workflow before doing any global S&R in the future, this will force the conversion. Having the editor automatically beautify the files on opening masked the issue - viewed files had been converted, unviewed ones hadn't.
Being pedantic wouldn't your Code:
( )+ {2,} format for multiple spaces which is why I also use that format ({1,}) for "one or more", just habit I suppose. BobC |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Non-breaking space | JSWolf | ePub | 38 | 06-09-2020 09:00 PM |
[old thread] non breaking spaces (* and  ) automatically removed | artoros | Sigil | 31 | 09-04-2014 06:23 PM |
Use of nonbreaking space ( ) | Ti-Ron | ePub | 10 | 04-14-2013 10:57 PM |
DEAN KOONTZ ODD THOMAS $1.99 12/28 ONLY (K & BN) | bookratt | Deals and Resources (No Self-Promotion or Affiliate Links) | 1 | 12-28-2012 10:03 PM |
Odd occurance with Sigil & Calibre | slayda | Sigil | 5 | 09-15-2009 05:58 PM |