|
|
#1 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 452
Karma: 1152538
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
|
Find/Replace bug?
<p class="para c2"> with: <p class="para"><span class="italic"> OK, first of all, I search for <p class="para"><span class="italic"> just to make certain none exist anywhere. Zero instances are found. Next I search for <p class="para c2"> and find that there are 33 instances. Next I enter <p class="para"><span class="italic"> in the replace field and click on Replace All. It says there were 33 replacements made. Now, there were only 33 instances of my find clause found, right, so how could there be more than 33 instances of my new clause when I search for it to see what all was changed? I don't know but when I go back and search for <p class="para"><span class="italic">, I see that there are now 477 instances rather than the expected 33. What the heck?! How is this possible? Anyone ever seen this sort of behavior or have any ideas? I'm currently using v.0.5.3 Thanks. - Byron Followell
__________________
Underachievement - Because soaring with the eagles requires so much more effort. Amazon Kindle 3 wi-fi B&N Nook Tablet Last edited by bfollowell; 05-18-2012 at 08:19 PM. |
|
|
|
|
|
#2 |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,690
Karma: 2485828
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
para and c2 are 2 different styles to start with(they cascade).
Next you did not close the Span in a known place ![]() Code:
<p class="para"><span class="italic">Stuff</span></p>
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
Enthusiast
|
|
|
|
#3 | |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 452
Karma: 1152538
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
|
Quote:
As far as not ending the span in a known location, that isn't really an issue. The span ends on each paragraph, like I expected and wanted it to. None of what you pointed out explains to me why Sigil made 33 replacements but I then search and find 477 results. It makes no sense to me. - Byron
__________________
Underachievement - Because soaring with the eagles requires so much more effort. Amazon Kindle 3 wi-fi B&N Nook Tablet |
|
|
|
|
|
|
#4 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,813
Karma: 23106788
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
Bad things happen when you allow tags to be automagically closed for you.
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” |
|
|
|
|
|
#5 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 452
Karma: 1152538
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
|
I guess I'm finding that out the hard way. Luckily I was editing a copy so I haven't really screwed anything up. I guess I'll go through and fix them manually.
Thanks guys. - Byron
__________________
Underachievement - Because soaring with the eagles requires so much more effort. Amazon Kindle 3 wi-fi B&N Nook Tablet |
|
|
|
|
|
#6 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 452
Karma: 1152538
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
|
I think what I need then is a regex expression that will let me find:
<p class="para c2">“Ignore whatever characters may be in this paragraph.”</p> and replace it with: <p class="para"><span class="italic">“Ignore whatever characters may be in this paragraph.”</span></p> Any suggestions? I'm OK with extremely basic regex but I get lost when trying to build larger expressions that will look for something specific with some random text in the middle and then allow me to replace the exact portion of random text as is. - Byron
__________________
Underachievement - Because soaring with the eagles requires so much more effort. Amazon Kindle 3 wi-fi B&N Nook Tablet |
|
|
|
|
|
#7 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 5244
Join Date: Jul 2010
Device: none
|
If you have:
Code:
<p class="foo"><span class="bar">some text</p> <p class="foo">some more text</p> For example, Tidying a file with unclosed tags (e.g. a <span>), you'll get something like: line 7 column 16 - Warning: missing </span> before </p> line 9 column 16 - Warning: inserting implicit <span> line 11 column 16 - Warning: inserting implicit <span> so, yeah, be very careful about unclosed tags with Tidy, e.g. when doing a Replace All in Sigil. |
|
|
|
|
|
#8 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,686
Karma: 772746
Join Date: Sep 2010
Device: Sony PRS 650, Kindle for PC
|
Quote:
find <p class="para c2">(.*)</p> replace <p class="para"><span class="italic">\1</span></p> but having span in the replace is superfluous so replace <p class="para" "italic">\1 </p> is neater PS so in fact why bother - just define class c2 to mean italic & you are done! |
|
|
|
|
|
|
#9 | |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 452
Karma: 1152538
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
|
Quote:
Still, this little exercise taught me quite a bit. Thanks for all of your help and advice everyone. - Byron
__________________
Underachievement - Because soaring with the eagles requires so much more effort. Amazon Kindle 3 wi-fi B&N Nook Tablet |
|
|
|
|
|
|
#10 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,686
Karma: 772746
Join Date: Sep 2010
Device: Sony PRS 650, Kindle for PC
|
the use of (.*) and \1 to preserve everything between tags is a useful trick
but beware of using it between <div and </div> - that seems to go horribly wrong ( in v4.3 old style regex anyway). I have struggled to find a way to fix up books that use thousands of <div> tag pairs, one set per paragraph, and to replace with <p?> tag pairs i.e. find <Div class =..>"every single paragraph"</div> replace with <p> tags instead of <div> tags |
|
|
|
|
|
#11 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,690
Karma: 2485828
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
Code:
<p class="para italic"> Pay attention to the order if there are updated elements. Just to be clear: You are removing C2 class and substituting italic class? Maybe all you needed to do was add/adjust the c2 class in the style sheet. Code:
font-stye: italic
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
|
#12 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,813
Karma: 23106788
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
Quote:
Nothing's worse than working with an epub that is filled entirely with: Code:
<p class="something"><span class="something-else">blah, blah, blah</span></p> <p class="something"><span class="something-else">blah, dee, blah, dee, blah</span></p> <p class="something"><span class="something-else">blah, dee, blah, blah</span></p> <p class="something"><span class="something-else">blah, dee, blah, blah, blah</span></p>
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” Last edited by DiapDealer; 05-19-2012 at 08:28 AM. |
|
|
|
|
|
|
#13 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,690
Karma: 2485828
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
Calibre wont handle that in conversion? (You can tell I don't do many Mobi )
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
|
#14 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,813
Karma: 23106788
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
Calibre deals with multiple css classes being assigned to one element pretty well when converting ePub to MOBI. It's kindlegen that can't (or couldn't) handle it.
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” |
|
|
|
|
|
#15 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,690
Karma: 2485828
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
Wheew!
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| Crashes on find / replace all | mr ploppy | Sigil | 1 | 02-03-2010 12:35 PM |
| Using Find/Replace with BD | Otter | Sony Reader | 7 | 02-28-2009 01:49 PM |