Changeset 31979

Show
Ignore:
Timestamp:
04/06/09 11:21:44 (4 years ago)
Author:
isaisstillalive
Message:
  • エントリ自動内部リンクの正規表現のid部分が適当すぎた
Location:
lang/ruby/haikuchat
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/haikuchat/lib/log.rb

    r31772 r31979  
    4242            type, value = :keyword, string 
    4343          when "h" 
    44             haiku_matches = %r{http://h.hatena.ne.jp/(\w+)/(\d+)}.match(string) 
     44            haiku_matches = %r{http://h.hatena.ne.jp/([a-zA-Z][-a-zA-Z0-9_]{1,30}[a-zA-Z\d])/(\d+)}.match(string) 
    4545            if haiku_matches 
    4646              type, value = :entry, haiku_matches[2] 
  • lang/ruby/haikuchat/test/test_log.rb

    r31772 r31979  
    8686   
    8787  [ 
    88     %w{http://example.com/             url     http://example.com/ http://example.com/}, 
    89     %w{http://h.hatena.ne.jp/user/1234 entry   http://h.hatena.ne.jp/user/1234 1234}, 
    90     %w{[[auto_keyword]]                keyword auto_keyword auto_keyword}, 
    91     %w{id:auto_user                    user    id:auto_user id:auto_user}, 
     88    %w{http://example.com/                url     http://example.com/ http://example.com/}, 
     89    %w{http://h.hatena.ne.jp/user-id/1234 entry   http://h.hatena.ne.jp/user-id/1234 1234}, 
     90    %w{[[auto_keyword]]                   keyword auto_keyword auto_keyword}, 
     91    %w{id:auto_user                       user    id:auto_user id:auto_user}, 
    9292  ].each do |source, type, string, value| 
    9393    class_eval <<-"END"