module MiniSyntax
module Highlighter
module CommandLine
def self.highlight(code)
code = '' + code.gsub(/\n/, %Q(\n)) + ''
code.gsub! %r((\#.*?)$) do |comment|
if comment =~ %r()
comment
else
comment.gsub! %r(?(b|i|em|var|code|kbd)>), ""
%Q(#{comment})
end
end
code.gsub! %r(), ""
code
end
end
end
end
MiniSyntax.register(:command_line, MiniSyntax::Highlighter::CommandLine)