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 07-29-2014, 01:50 PM   #1
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
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>
The * is a nbsp character - MR renders is thus.
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>
So I constructed a S&R :

Code:
Search :<p>*{1,} 
Replace: <p class="indent">
Where the character after the <p> is the non-breaking space inserted using the editor's "Special Character" tool , with options Regex, Wrap, Dotall and applied to "All text files"

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,}
Anybody any ideas why and how I can apply the S&R to "All Text Files"

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
BobC is offline   Reply With Quote
Old 07-29-2014, 10:07 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
(&nbsp;)+
to search for multiple entity non-breaking spaces.

Or use
Code:
(*|&nbsp;)+
(where asterisk is unicode nbsp) to find either one.

(The plus and {1,} do exactly the same thing. opinion: plus is easier to read.)
eschwartz is offline   Reply With Quote
Advert
Old 07-30-2014, 04:19 AM   #3
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
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:
(&nbsp;)+
search find single as well as multiple non-breaking spaces ? I tend to use the
{2,} format for multiple spaces which is why I also use that format ({1,}) for "one or more", just habit I suppose.

BobC
BobC is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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 &#x00A0;) automatically removed artoros Sigil 31 09-04-2014 06:23 PM
Use of nonbreaking space (&nbsp;) 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


All times are GMT -4. The time now is 05:59 AM.


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