module Filters module PreFilter def format_command_line(text) text.gsub /^\n?\s*``` command-line(.+?)```/m do |block| block.gsub! /^\s*``` command-line/, '
'
        block.gsub! /^\s*```$/, "
\n" block.gsub!(/^\s*\$ (.+)$/) { %(#{$1.rstrip}) } block.gsub!(/^\s*(\# .+)$/) { %(#{$1.rstrip}) } block.gsub!(/^\s*> (.+)$/) { %(#{$1.rstrip}) } block end end end end