app/models/feed.rb
# htmlize the html codes back.
htmlize the html codes back.
htmlize the html codes back .
def htmlize(string, link=nil)
    string.gsub!('&lt;', '<')
    string.gsub!('&gt;', '>')
    string.gsub!('&amp;', '&')
    string.gsub!('&#39;', "'")
    string.gsub!('&quot;', '"')
    string.gsub!('<![CDATA[', '')
    string.gsub!(']]>', '')
    return string
  end
def htmlize ( string , link = nil ) string . gsub! ( '&lt;' , '<' ) string . gsub! ( '&gt;' , '>' ) string . gsub! ( '&amp;' , '&' ) string . gsub! ( '&#39;' , "'" ) string . gsub! ( '&quot;' , '"' ) string . gsub! ( '<![CDATA[' , '' ) string . gsub! ( ']]>' , '' ) return string end
htmlize the html codes back.
htmlize the html codes back .
# for image srcs like <img src="/assets/2008/4/23/rails3.jpg_1208810865" />" # adding host so that they become valid # "<img src="http://www.google.com/assets/2008/4/23/rails3.jpg_1208810865" />" #    if link #        host = URI.parse(link).host #        if host != "feeds.feedburner.com" #          string.gsub!("src=\"/", "src=\"http://"+host+"/") #        end #    end
string
link