aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/track_controller.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-06-25 12:49:17 +0100
committerGareth Rees <gareth@mysociety.org>2014-06-25 12:49:17 +0100
commitfe5880e555f98350b4c08a4885c560e35692687f (patch)
tree31ae4a508ec50a1c4801a56d85f1329848358380 /app/controllers/track_controller.rb
parentc99c9ef86c9020939cf8d0930faca5bd206e111f (diff)
parentf23b89f3474847cdd14ba892c5a7259964e18148 (diff)
Merge branch 'issues/1434-email-highlighting' into rails-3-develop
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r--app/controllers/track_controller.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index c15fb573d..83700a55b 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -154,7 +154,15 @@ class TrackController < ApplicationController
request.format = 'xml' unless params[:format]
respond_to do |format|
format.json { render :json => @xapian_object.results.map { |r| r[:model].json_for_api(true,
- lambda { |t| view_context.highlight_and_excerpt(t, @xapian_object.words_to_highlight, 150) }
+ lambda do |t|
+ view_context.highlight_and_excerpt(
+ t,
+ @xapian_object.words_to_highlight(
+ :regex => true,
+ :include_original => true),
+ 150
+ )
+ end
) } }
format.any { render :template => 'track/atom_feed',
:formats => ['atom'],