I wrote a ton of web pages with the same body structure but slightly different code in the header and footer. I'd like to standardize them to all be the same.
What I need to do is extract everything inside <div id="authored-area">...</div> and put it in a new template. I also need this to be automated, because I have a couple hundred pages. Would anyone know where to start?
That was one of the first things I thought of, but I couldn't figure out how it would work. The reason is that there are nested divs, and so I can't figure out where the correct closing </div> is. Is there a way?
Yes - definitely! I'm not very good at this sort of stuff, so I can't help you with code, but I've seen it done - basically, with regular expressions you can find <div id="authored-area"> and tell the program to delete everything from the end of that string to the start of the first </div> it comes across... and bingo! Wish I could show you the code - but I bet a bit of Googling will help at this point...
Bookmarks