=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, $2 end title = title.to_s.strip cite = cite.to_s.strip strings = [] strings << '' strings << "
" strings << '' strings << '' str = strings.join } end case type when :AFTER_P str.gsub!(/' strings << str strings << '
' if title.size > 0 || cite.size > 0 title = '.' if title.size == 0 string = "#{title}" string = "" + string + '' if cite.size > 0 string = 'cite( ' + string + ' )' strings << string end strings << '
(.*?\s*)
<\/p>/mi, '') #それとも意図はこっち? これはAFTER_Pでなくても可能だろう # str.gsub!(/(.*?\s*)
' + $1 + '