aboutsummaryrefslogtreecommitdiffstats
path: root/spec/libs/format_spec.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-04-23 13:41:43 +0000
committerfrancis <francis>2009-04-23 13:41:43 +0000
commit44dd21146a9220daf479bcf2f064c12cdcd85706 (patch)
treed997178afbf9aa8857b1770a516c0827d0053e0a /spec/libs/format_spec.rb
parentb279c1b38d4a5d464a4d7c2939104bf57857fbd8 (diff)
Don't be greedy, or will eat to many newlines that span to next URL.
Diffstat (limited to 'spec/libs/format_spec.rb')
-rw-r--r--spec/libs/format_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/libs/format_spec.rb b/spec/libs/format_spec.rb
index df25a78c2..a97e7cd9e 100644
--- a/spec/libs/format_spec.rb
+++ b/spec/libs/format_spec.rb
@@ -12,12 +12,14 @@ describe "when making clickable" do
it "should make wrapped URLs in angle brackets clickable" do
text = """<http://www.flou
rish.org/bl
-og>"""
+og>
+
+More stuff and then another angle bracket >"""
text = CGI.escapeHTML(text)
formatted = MySociety::Format.make_clickable(text)
- formatted.should == "&lt;<a href='http://www.flourish.org/blog'>http://www.flourish.org/blog</a>&gt;"
+ formatted.should == "&lt;<a href='http://www.flourish.org/blog'>http://www.flourish.org/blog</a>&gt;\n\nMore stuff and then another angle bracket &gt;"
end
end