diff --git a/lib/cfm.rb b/lib/cfm.rb
index ca386798..6ca133ca 100644
--- a/lib/cfm.rb
+++ b/lib/cfm.rb
@@ -26,6 +26,9 @@ def render(text)
def add_nofollow( html)
#redcarpet isn't adding nofollow like it is suppose to.
+ if html.match(/rel=["']nofollow["']/)
+ return html
+ end
html.scan(/(\.*?\<\/a\>)/).flatten.each do |link|
if link.match(/\(.*?)\<\/a\>/)
else
diff --git a/spec/helpers/protips_helper_spec.rb b/spec/helpers/protips_helper_spec.rb
index 1bf85191..97a1620e 100644
--- a/spec/helpers/protips_helper_spec.rb
+++ b/spec/helpers/protips_helper_spec.rb
@@ -40,6 +40,16 @@
expect(helper.users_background_image).to be_nil
end
end
+
+ describe "comments" do
+ context "has comments" do
+ it "renders comment links correctly" do
+ expect(formatted_comment("http://www.google.com")).to eq "http://www.google.com
\n"
+ end
+ end
+ end
+
+
end
end