+
+ class Renderer < Redcarpet::Render::XHTML
+ def link(link, title, alt_text)
+ "<a rel=\"nofollow\" href=\"#{link}\">#{alt_text}</a>"
+ end
+
+ def autolink(link, link_type)
+ if link_type == :email
+ "<a rel=\"nofollow\" href=\"mailto:#{link}\">#{link}</a>"
+ else
+ "<a rel=\"nofollow\" href=\"#{link}\">#{link}</a>"
+ end
+ end
+ end
+ end
+
+ class Text < Base
+ def to_html
+ linkify(simple_format(ERB::Util.html_escape(self)))
+ end
+
+ def to_text
+ self.to_s
+ end