View Single Post
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