From c296d0d1d5fe06e46ef62786de91c8308170b31d Mon Sep 17 00:00:00 2001 From: elixirel Date: Thu, 17 Sep 2009 21:40:10 +0900 Subject: [PATCH] str.strip! is reversed. (but, unsupported ruby-1.9.1) --- feedgenerator.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feedgenerator.rb b/feedgenerator.rb index 61ebef0..6e22b03 100644 --- a/feedgenerator.rb +++ b/feedgenerator.rb @@ -97,7 +97,7 @@ class AbstractEntry @paramlist.each do |key| val = hash[key.to_sym] || hash[key.to_s] if val - # val.strip! + val.strip! val.gsub!(/\r\n|\r/, "\n") @attr[key.to_sym] = CGI.escapeHTML(val) else @@ -440,7 +440,7 @@ class Entry < AbstractEntry # データソースから読み取ったHTMLを、エディタで編集可能な形式に変換するメソッドです def content_for_generator str = @attr[:content].dup - # str.strip! + str.strip! str.gsub!(/(<\/(?:p|h\d|div)(?:>|>))\n/i, '\1') str.gsub!(/\n/, '<br>') if REPLACEBRTAG str.gsub!(/(<(?:(?!>).)*?)#{Regexp.escape(FEEDXMLDIR)}/) { "#$1#{XMLPATH}" } @@ -451,7 +451,7 @@ class Entry < AbstractEntry def content_for_blog str = @attr[:content].dup str = CGI.unescapeHTML(str) - # str.strip! + str.strip! str.gsub!(/(\r\n|\n)/, "") str.gsub!(/
/i, "\n") if REPLACEBRTAG str.gsub!(/(
|<\/p>|<\/h\d>|<\/div>)(?=[^\n])/i) { "#$1\n" } unless REPLACEBRTAG @@ -463,7 +463,7 @@ class Entry < AbstractEntry def content_for_view str = @attr[:content].dup str = CGI.unescapeHTML(str) - # str.strip! + str.strip! str.gsub!(/
/i, "\n") if REPLACEBRTAG str.gsub!(/(<[^>]*?)#{Regexp.escape(FEEDXMLDIR)}/) { "#$1#{XMLPATH}" } str -- 2.11.0