I’ve decided to embark on a little project I’ve been wanting to do for some time. Sort of my version of Tidy, except covering some really old proprietary tags also. The other benefit of this, aside from the obvious, is that this will (ideally) also help me improve my PHP skills.
Essentially, I’m creating an online code parser that will skim out and replace old tags with the appropriate standards compliant ones. I’m starting slow, primarily because my knowledge of advanced string manipulation in PHP is rather minimal. Eventually, I’d like to be able to really expand this project into a lot more, but those are ideas for another discussion.
What I have done so far is this:
- Replaces MS Word Smartquotes with normal entities.
- <b> = <strong>
- <i> = <em>
- <u> = <span style=”text-decoration:underline”>
- <br> = <br />
- <hr> = <hr />
- <dir> and <menu> = <ul>
- <s> and <strike> = <del>
- <xmp> = <pre>
I have quite a few things on my list of what I would like to do, and it will get done as soon as I figure out how to use PHP to manipulate the data entered and create what I’m looking for. For now, this is a rather quick and dirty little online form that will solve a lot of the most basic validating errors for old web pages.
I’m keeping the project here:
http://www.websitestyle.com/code_cleaner/ if you want to try it out.
~Nicole