Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-06-2012, 09:39 AM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
find replace bug?

i try to remove a redundant class, using:
find
span class="calibre3"
replace all
span

it destroys the <> syntax which surrounds the span, both when run as normal, & when run as regex
i.e. it leaves this mess throughout
&lt; span&gt;

same happens if i try find
<span class="calibre3">
replace all
<span>

it does not happen for a single find + replace next but I want to remove hundreds of these

they are in constructs like:
<div class="calibre15">
<span class="calibre3">Yuen giggled, but Streicher sighed. "Dr. McLeod, must everything be a joke to you?"</span>
</div>

why won't replace all work properly?



PS i can find
class="calibre3"
and replace with blank - that works OK

I can then find
<span>
and replace with blank & the the closing matching tags then disappear also

so: pretty sure its a side effect of the option which used to appear as a brush thingie - tidy ? but don't see how to toggle it on/off in v6
cybmole is offline   Reply With Quote
Old 11-06-2012, 10:06 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Edit: Preferences: Clean Source

I use Pretty Print without that fault.

BTY I tend to find and replace the Full span tag, not just the text part
theducks is offline   Reply With Quote
Advert
Old 11-06-2012, 10:39 AM   #3
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
ok thanks
- I see the 3 preference options:
off
pretty print ( = default ? - that is what my v6 install was set to.)
tidy

is tidy the old ( v4) default
off is self explanatory

I cleaned that book in multiple stepsas per end of my post , so I can't go back & re-test, but if I hit this again I will try changing those preference settings.

is "pretty print" documented anywhere yet ?

you say that it should have worked OK with the pretty print option selected ?

UPDATE: I googled & found the documentation, which confrimed that pretty print IS the default.

My reading of the documentation suggests that I have found & reported a bug- I see nothing to indicate that pretty print would cause what i described previously , when a replace all is run. ?. Maybe it only occurs inside of <Div> constructs as per my sample code ?

Last edited by cybmole; 11-06-2012 at 11:06 AM.
cybmole is offline   Reply With Quote
Old 11-06-2012, 11:21 AM   #4
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by cybmole View Post

UPDATE: I googled & found the documentation, which confrimed that pretty print IS the default.
You googled to find the documentation?

Maybe we need to change that "Help" menu item to "Free donuts" or something.
meme is offline   Reply With Quote
Old 11-06-2012, 12:01 PM   #5
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
I can't get it to fault with the behaviour you describe, no matter which Tidy mode etc is used. The only time I see &gt; inserted in the html is when I screw up with my find/replace and am not careful about closing a xml tag. As theducks says I would always replace the *whole* tag anyway, rather than trying to fiddle with the inner contents.

Provide an example epub attachment and exactly what all your settings are to replicate it, though I doubt there is much we can do about it in any case.

Note that there will one day be some changes to how Replace All behaves with regards to "cleaning" afterwards. As has been said many times Sigil is currently very dependent on only working with valid xhtml. In turn the user only gets prompted about stuff made invalid in a tab they have open. In the case of a Replace All operation because you could make html invalid in resources that are not currently open in a tab (using Replace in All Files) it currently does a minimal "clean" after a Replace All that does not happen when you do a manual Find/Replace. This ensures that for instance if you do a Find of "<span class="calibre3">" and a Replace of nothing that it automatically removes the closing matching </span> tags. It can be a very handy "feature" if carefully used, equally you can trash your whole epub with a careless typing in Find/Replace.

It will one day be all tied into the same Clean Source options (a new option is being added for 0.6.1 at the moment) to allow user control of this. However vast amounts of Sigil need changing to fully enable it, there will be tears and pain along the way.
kiwidude is offline   Reply With Quote
Advert
Old 11-06-2012, 12:38 PM   #6
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by meme View Post
You googled to find the documentation?

Maybe we need to change that "Help" menu item to "Free donuts" or something.
I'd read in several places that documentation was lagging on latest versions so googling pretty print seemed the obvious choice.

OK , now I've found that book in my backup library, extracted one small random piece, to keep the copyright police happy & am attaching it as test.epub.

I can duplicate the reported fault in that, no problem. just do the find/replace all processes as per the 1st post & see what happens please. I am running sigil v6.0 in win 7 64 bit, installed over previous betas.

to be extra secure, I will delete the attachment once you folks confirm that you have grabbed it.

ps the calibre styles are actually undefined in that test.epub as I just took a page from code view & dropped it into a new epub. but it should serve to demonstrate the fault.
I use
find
span class="calibre3"
replace (all)
span

& I get the &lt. &gt. stuff
Attached Files
File Type: epub test.epub (3.0 KB, 165 views)

Last edited by cybmole; 11-06-2012 at 12:43 PM.
cybmole is offline   Reply With Quote
Old 11-06-2012, 12:47 PM   #7
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I think screenshots might be in order - of your Find & Replace dialog (expanded to show Options), and before/after of an area of text.

With 0.6.0, Clean Source = Pretty Print, regardless of the options/modes I try, Doing a find/replace of

find: span class="calibre3"
replace: span

works perfectly. Wonder what we're missing...
meme is offline   Reply With Quote
Old 11-06-2012, 12:53 PM   #8
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by meme View Post
I think screenshots might be in order - of your Find & Replace dialog (expanded to show Options), and before/after of an area of text.

With 0.6.0, Clean Source = Pretty Print, regardless of the options/modes I try, Doing a find/replace of

find: span class="calibre3"
replace: span

works perfectly. Wonder what we're missing...
well I wonder what we're missing also. screen shots are a pain, & I've posted before & after text samples. let's go again, using 1st para of test.epub:
BEFORE:
<div class="calibre12">
<span class="calibre3">Jiayuguan City was named after a section of a wall. Not just any wall. The Great Wall of China. And in the fourteenth century, the Jiayuguan Pass, or fortress, was the westernmost point of the Great Wall. A formidable structure, it was once called the "The First and Greatest Pass Under the Heaven."</span>
</div>
AFTER
<div class="calibre12">
&lt; span&gt;Jiayuguan City was named after a section of a wall. Not just any wall. The Great Wall of China. And in the fourteenth century, the Jiayuguan Pass, or fortress, was the westernmost point of the Great Wall. A formidable structure, it was once called the "The First and Greatest Pass Under the Heaven."
</div>
MY SEARCH OPTIONS:
NORMAL, All FILES, DOWN, the 3 options on the next line are unticked.
FIND FIELD CONTENT
span class="calibre3"
REPLACE FIELD CONTENT
span

AHA - I see a leading space in the replace field, which I can now see because I did copy paste from sigil.
That's the culprit. get rid of that & the bug goes away
. You can't see that because when I submit the post, it gets removed, but trust me, it exists!

so please re-test with a spurious leading space & see what you get then.
cybmole is offline   Reply With Quote
Old 11-06-2012, 01:22 PM   #9
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Glad you found it. But any number of blank spaces doesn't cause a problem. Must be an invisible character?

If you can attach your sigil.ini file - or just the find_replace section that contains your find/replace history. Use Preferences: Open Preferences Location button to find the file.
meme is offline   Reply With Quote
Old 11-06-2012, 01:39 PM   #10
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@meme - I can replicate it with a leading space in the replace field - note you have to be set to "all html files" not "current file" to see it.

It's still not a bug though, this is a combination of user error and the "clean" behaviour deciding that what is left is not a valid xml tag.
kiwidude is offline   Reply With Quote
Old 11-06-2012, 02:06 PM   #11
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by kiwidude View Post
@meme - I can replicate it with a leading space in the replace field - note you have to be set to "all html files" not "current file" to see it.

It's still not a bug though, this is a combination of user error and the "clean" behaviour deciding that what is left is not a valid xml tag.
I'll confess to to the user error part - I have lots of trouble spotting leading / trailing spaces when I use find replace.
I swear they self-install when I'm away from Pc. anyway, here's the .ini file in case you still need it. looks like I'll have to zip it before attaching
Attached Files
File Type: zip sigil.zip (5.1 KB, 155 views)
cybmole is offline   Reply With Quote
Old 11-06-2012, 02:13 PM   #12
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@cybmole - yeah I get caught out every now and then too - particularly trailing line feeds from the "invisible" character that code view uses to terminate lines. Just have to pay close attention to your selections

Also as said above you will be less error prone if you replace the whole tag including the angle brackets - that way an accidental space before or after the tag will have no impact.
kiwidude is offline   Reply With Quote
Old 11-06-2012, 03:49 PM   #13
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by kiwidude View Post
...

Also as said above you will be less error prone if you replace the whole tag including the angle brackets - that way an accidental space before or after the tag will have no impact.
it went wrong with the angle brackets also, when leading space was left in. see 2nd of my 2 original examples:
I'd tried find
<span class-"calibre3">
replace all ( all files)
<span>
but with an accidental space before the replace, & it had bugged out
cybmole is offline   Reply With Quote
Old 11-06-2012, 04:27 PM   #14
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
It should only go wrong with the space if you have the space between the "<" and "span". And that is an awful lot easier to spot than a true leading/trailing space.
kiwidude is offline   Reply With Quote
Old 11-07-2012, 01:17 AM   #15
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by kiwidude View Post
It should only go wrong with the space if you have the space between the "<" and "span". And that is an awful lot easier to spot than a true leading/trailing space.
you are right, I looked at the search history & sure enough , I saw < span>.

it was less obvious in the actual search box though, with my eyesight!

this may have been discussed elsewhere already but is there / willl there be someday an option to make the search boxes appear larger ?
cybmole is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace - possible bug? PL_kolek Conversion 2 11-01-2012 06:56 AM
Find/Replace bug? bfollowell Sigil 14 05-19-2012 01:14 PM
Find Replace unrulyguides Sigil 5 02-17-2012 08:38 PM
Find/Replace Won't Find Rand Brittain Sigil 7 09-24-2011 04:35 AM
Find / replace bremler Sigil 6 12-17-2010 03:26 PM


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


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