wp-markdown-syntaxhighlighter 0.2.1

It turns out that once I get bothered by something it doesn’t take me very long to work on it. I added an additional syntax to support passing all of the SyntaxHighlighter parameters in as JSON. The first method looks like this:

#!ruby
class Foo < Bar
  def hello
    puts "Hello World!"
  end
end

This works as before and properly sets the brush type: [ruby]class Foo < Bar def hello puts "Hello World!" end end[/ruby] The second method looks like this:

#!!{"brush":"ruby","toolbar":"false","highlight":"[2,3,4]"}
class Foo < Bar
  def hello
    puts "Hello World!"
  end
end

This one appends all of the valid parameters as class names so that SyntaxHighlighter can do its business:

#!!{"brush":"ruby","toolbar":"false","highlight":"[2,3,4]"}
class Foo < Bar
  def hello
    puts "Hello World!"
  end
end

It’s pretty darn nifty, though I discovered that the plugin seems to have a problem with more than one code block in a post, like this one. I guess that's next up in the to-fix list!

Plugin download removed.

Sep 4th, 2012

Comments