From db6274c90dc88a2a2ca22a78779a705ecb074465 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 13 Jan 2009 15:49:04 +0000 Subject: Ruby Scanner: Shebang comments are highlighted as :doctype. --- lib/coderay/scanners/ruby.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/coderay') diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 90c640a..721f0e4 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -147,6 +147,10 @@ module Scanners tokens << [match, kind] next + elsif bol? && match = scan(/\#!.*/) + tokens << [match, :doctype] + next + elsif match = scan(/\#.*/) or ( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) ) kind = :comment -- cgit v1.2.1