=begin http://www14.cds.ne.jp/~not/tawagoto/200102c.html#26_t2 特定の日付でのみ有効にできるようフィルタを追加して読み込むフィルタです。日記内に Filter: bookstore ol のようなブロックを書いておくとその日でのみそこに記述されたフィルタを追加して有効にします。普段は使わないけど、たまに使うかもしれないフィルタがあれば使えるかも。(2003-11-24修正) =end # addfilter.rb class Filter def addfilter(str, type) case type when :ONEDAY @addfilterlist = nil list = [] if str.gsub!(/(?:\A\n?|\n\n)Filter:\s*\n(.+?)(?:\Z|\n\n)/im){ $1.each{ |line| line.strip! list << line if !@filterlist.index(line) and !line.to_s.empty? } "\n\n" } then @addfilterlist = Filter::new(list, @diary.config['USER_FILTER_DIRECTORY']) @addfilterlist.parentdiary = @diary end end unless @addfilterlist.nil? then return :THROUGH if @addfilterlist.filter(str, type) end end end