=begin 「Cite:」 notiz Freitag,18.Oktober.2002 http://www1.skz.or.jp/~kusumi/klee/notiz/200210.html#d18_t3 あたりの話題を参考に。 usage: Cite: test(http://www.quote.test) てすとー。 =end class Filter def cite(str, type) case type when :P str.sub!(/^Cite:(.*?)?\n(.*)/mi){ param = $1 str = $2 title, cite = param.to_s, '' if param =~ /(.*)\((.*)\)/ title, cite = $1.to_s.strip, $2.to_s.strip end strings = [] strings << "
\n" strings << str if title.size > 0 || cite.size > 0 title = '.' if title.size == 0 string = "#{title}" string = "" + string + '' if cite.size > 0 string = '' + "\n" str = strings.join } end end endcite( ' + string + ' )' strings << "\n#{string}\n" end strings << '