aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/public_body.rb6
-rw-r--r--app/views/body/_body_listing_single.rhtml2
2 files changed, 6 insertions, 2 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 60f1ed183..e8809c8f5 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -26,7 +26,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: public_body.rb,v 1.145 2009-06-16 22:21:13 francis Exp $
+# $Id: public_body.rb,v 1.146 2009-06-16 22:31:46 francis Exp $
require 'csv'
require 'set'
@@ -496,6 +496,10 @@ class PublicBody < ActiveRecord::Base
def notes_as_html
self.notes
end
+ def notes_without_html
+ # assume notes are reasonably behaved HTML, so just use simple regexp on this
+ self.notes.gsub(/<\/?[^>]*>/, "")
+ end
end
diff --git a/app/views/body/_body_listing_single.rhtml b/app/views/body/_body_listing_single.rhtml
index d8cd6efbe..c3c1c6730 100644
--- a/app/views/body/_body_listing_single.rhtml
+++ b/app/views/body/_body_listing_single.rhtml
@@ -9,7 +9,7 @@
<span class="desc">
<% if not public_body.short_name.empty? %>
Also called <%=highlight_words(public_body.short_name, @highlight_words) %>.
- <%= highlight_and_excerpt(public_body.notes, @highlight_words, 150) %>
+ <%= highlight_and_excerpt(public_body.notes_without_html, @highlight_words, 150) %>
<br>
<% end %>
</span>