[theme-reviewers] CSS parser

Ryan Hellyer ryan at pixopoint.com
Wed Sep 29 22:25:25 UTC 2010

> From: Otto <otto at ottodestruct.com>
> Neat, but is there any particular reason you didn't want to use CSSTidy?
> http://csstidy.sourceforge.net/
> -Otto

Actually, it does. I got the bulk of the code from the SafeCSS plugin
by Automattic (which does extra security sanitisation). I just added a
few extra bits to make it match most of the WP coding standards.

I needed it for a client's plugin which allows for user
submitted/stored CSS and figured I may as well make their code look
WordPress'y. Turning that into a processing page on my site was pretty
straightforward, hence why I made it.

If you happen to know how to make CSSTidy retain the comment code,
that would be really handy as it is currently stripping it out.

More information about the theme-reviewers mailing list