diff --git a/app/controllers/announcement_feeds_controller.rb b/app/controllers/announcement_feeds_controller.rb index a45fc47..52fd71a 100644 --- a/app/controllers/announcement_feeds_controller.rb +++ b/app/controllers/announcement_feeds_controller.rb @@ -47,6 +47,8 @@ class AnnouncementFeedsController < ApplicationController def smart_convertor(text) html_string = text links = html_string.scan(/img.*?src="(.*?)"/i) + links = links + html_string.scan(/a.*?href="(.*?)"/i) + links.uniq! links.each do |link| l = link.first new_link = nil @@ -56,7 +58,7 @@ class AnnouncementFeedsController < ApplicationController l1 = l.gsub("../","") new_link = request.protocol + request.host_with_port + "/" + l1 end - html_string = html_string.sub(l,new_link) if !new_link.nil? + html_string = html_string.gsub(l,new_link) if !new_link.nil? end return html_string end