aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorfrancis <francis>2009-06-16 22:31:46 +0000
committerfrancis <francis>2009-06-16 22:31:46 +0000
commit5bf0f5fe25844e3fe91f70e02fa7604f0421687b (patch)
treec088ab88221297ca703bb5f77e38721e60e12cf8 /app/models
parent74c12dc0808fe8752aaf3c4832ad26fb37ca6df0 (diff)
Strip HTML from snippets of notes search.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/public_body.rb6
1 files changed, 5 insertions, 1 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