friendyl

friendyl

Wordpress Post Friendly Code With JavaScript Replace

Thursday, February 12, 2009 - 12:03

I recently talked about adding code to blogs and comments to Wordpress and making sure that certain characters are encoded properly. So to simplify things I thought I would create a little set of regular expressions that takes a sample of code and convert it into a Wordress friendly format. It consists of the following function, which takes the value of a text area called tochange and runs some regular expression replace functions on it.

Category: