t = false s.gsub!(/\<p\>([\S\s]+?)\<\/p\>/) {|m| paraj = m.gsub(/\<\/?p\>/, "") parao = paraj.gsub(/\<HR\>/, "") if (parao.include?("<FONT COLOR=\"#FF0000\">Derived from</FONT>")) t = true end if (paraj.include?("<HR>")) t = false end if (parao.include?("<H3>") or t) then "<p>\n<div class=\"j\">" + paraj + "</div>" else "<p>\n<div class=\"j\">" + paraj + "</div>\n<div class=\"o\">" + parao + "</div>\n</p>" end } s.gsub!(/\<pre\>([\S\s]+?)\<\/pre\>/, "</p><pre>\1</pre><p>")
end File.open(source+"l", "w") do |aFile| aFile.write(s) end
144 名前:の mailto:sage [03/05/25 15:59]
あ、最後間違えている…… File.open(source+"l", "w") do |aFile| aFile.write(s) end は File.open(source, "w") do |aFile| aFile.write(s) end ですね。