View Single Post
Old 06-18-2011, 03:44 PM   #1
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Tidy use and issue

I was cleaning up a book that started out as nearly pure text and was taking advantage of tidy.

Here is some of my experiences: I found a way to identify some text so that I could change an entire book with find and replace:

I made a span around some leading text and tidy make the /span at the end of the paragraph. I made a /span where I really needed it and tidy removed the one it built. Note that the first time I tried to put the /span in first but tidy removed it. the order is important.

Later I need to change certain paragraphs (chapters) to h3 so they would go in the TOC. I searched and replaced <p>Chapter ... with <h3>Chapter ... and expected tidy to fix the /h3 which it did. However, in a retro work around design dating back to html version 3 before css it also decided to add spacing so my file now looks like:

<h3>Chapter text<br />
<br /></h3>

Stupid tidy, a bug that needs fixing. However, now I have all these extra breaks. I am no expert on using regular expressions and this one has to cross a CR/LF sequence on my PC. How can a code the find to find and select both breaks?

Dale
DaleDe is offline   Reply With Quote