//
you're reading...
Syntax Highlighter, WP Plugins

A Couple WordPress Plugins

Since WordPress is GPL’d I figured it was time I offered up the changes I’ve made to the site. Most are pretty hackish but they suit my needs for now.

FixPRE (1.22KB) removes the line break/paragraph formatting that WordPress automatically adds to all posts, regardless of whether the text is inside of a pre tag. Some of the later nightly builds of WordPress remove the <br /> tags that get added but they leave the <p></p> tags that it generated.

Syntax Highlighter (78.2KB) tries to add some syntax highlighting to code within pre tags. It uses the rather good and slightly modified Beautifier script to perform the highlighting. Unfortunately it likes to format code as well as add syntax highlighting so it isn’t a perfect solution. It also doesn’t like to format HTML code, the downsides of trying to combine a tool meant to format regular code and not code that has been auto-formatted by a CMS tool.

The regex’s used by both were written before I bought the book I push below so don’t think the poor regex’s in my code are caused by the book 🙂

Update: Nish figured out the fixes needed to get the syntax highlighter to reformat our already formatted code. Simply commenting out a few lines and changing a trim to rtrim was all that was needed. The zip file has been updated with the latest code.

Advertisements

About James

I am a Senior Developer/Consultant for InfoPlanIT, LLC. I previously spent over 7 years as a Product Manager for what eventually became ComponentOne, a division of GrapeCity. While there, I helped to create ActiveReports 7, GrapeCity ActiveAnalysis, and Data Dynamics Reports.

Discussion

One thought on “A Couple WordPress Plugins

  1. The link to Syntax Highlighter does not work.

    Posted by torkar | May 17, 2004, 7:31 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archive

%d bloggers like this: