Figured I'd stop by to say, if there's anything I can do to help test / figure this out, or any further information I need to provide, please do let me know.
I should probably note that I'm using Dreamweaver CS5...
Not sure which tags you're trying to strip, but I often use the tag stripping feature in DW's Find & Replace tool.
Ctrl+F / Cmd+F
Current document | Folder | Selected Files | Entire Local Site
Search: Specific Tag | font, whatever...
Action: Strip Tag
Depending on what you're trying to accomplish, you may need to run it a few times.
Sorry for my tardy reply... I've been rather busy the last few weeks!
Thanks for the reply. Unfortunately this doesn't really help me, because it's not a handful of specific tags I need to strip, but rather all tags *except* specific ones. I'm given content that I'm expected to publish by a variety of sources, in all sorts of formats. (Various Word versions, PDFs, pre-existing web pages with formatting that doesn't match our own, you name it and I get it.) Hence pretty much any tag could show up, and most attributes could need stripping from the few tags I need to remain.
With Find & Replace, I'd be stuck having to go through the code by hand to see what needed replacing, then running a bunch of separate Find & Replace commands that would vary from document to document. Basically, what I do already.
I do appreciate your trying though, especially since you're the only reply I've had to date.
Any more suggestions, anybody?
Sounds like it might be easier to copy and paste your input into your page templates. Use Paste Special without formatting or with limited formatting. This strips out all tags. Then just go through and insert the proper tags. Alternatively, copy the new text into a plain text editor (like Notepad on the PC). I've found this to be pretty efficient, unless the formatting you are trying to preserve is really complex, and from the tags you're allowing, this doesn't seem to be the case..
Thanks, Barry. Paste Special is what I'm currently doing, but as you can imagine, it's mighty tedious cleaning up the formatting by hand on every single document, when the formatting I need is all there to start with in a regular paste -- just along with a bunch of extraneous formatting. With as many as a dozen or more documents to do each day, some with lengthy, nested lists and many bits of formatting that I need to keep, it's a bit soul destroying to have to do it manually.
I've since found a (very old) Dreamweaver Command extension that partially works, incidentally, and could perhaps be extended to do what I need -- but again, it would require me to understand code I simply don't, as yet.
The Remove Tags Except command there mostly works, but it seems to have an issue with nested tags that throws up an error message, and it also doesn't have a way for me to specify which attributes to keep, just which tags. Other than that it's close to ideal though -- the only other way it could be improved would be if I could kludge it to simply run straight away with a predetermined exclusions file, rather than making me manually select and load the exclusions every time.
I can understand how that can be a tedious process. DW's regex is a strange beast of uncertain ancestry. Takes a little getting use to (and I haven't done so yet).
If I have a chance I will take a look at that extension your found.
DW's regex is pretty much standard regex. Have you found that not to be the case?
Coming from an immersion in Linux regex I definitely found that I had to some rewriting of the code. The Adobe documentation was also at odds with regular regex, to coin a phrase.
Can't remember the exact issues off the top of my head but may have some documentation.
Murray: Yes, as noted previously, I have found that regex which validates and works elsewhere does not work in Dreamweaver. I don't have a specific example at just this moment, sorry. Seems Barry's had the same.
Barry, just wondering if you'd gotten a chance to look at that Dreamweaver command extension I'd linked to?