require 'wparser/parse' module Blocks class Pre < Parse BLOCK_TABLE = { ">||" => '
', "||<" => '', ">|code|" => '
', "|code|<" => '' } def self.parse line block_rex = %r! (^>\|\|)|(^\|\|<) # pre | (^\>\|code\|)|(^\|code\|\<) # google-code-prettify !x @result = line.gsub(block_rex){|s| BLOCK_TABLE[s]} super end end end