jugyo-termtter 0.8.9 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,12 +50,15 @@ module Termtter
50
50
  return []
51
51
  end
52
52
 
53
+ configatron.search.set_default(:highlihgt_text_format, '<on_magenta><white>\1</white></on_magenta>')
53
54
  def search(query)
54
55
  results = fetch_as_json(search_url_for("/search.json?q=#{CGI.escape(query)}"))['results']
55
56
  return results.map do |s|
56
57
  status = Status.new
57
58
  status.id = s['id']
58
- status.text = CGI.unescapeHTML(s['text']).gsub(/(\n|\r)/, '')
59
+ status.text = s['text'].
60
+ gsub(/(\n|\r)/, '').
61
+ gsub(/(#{Regexp.escape(query)})/i, configatron.search.highlihgt_text_format)
59
62
  status.created_at = Time.parse(s["created_at"])
60
63
  status.user_screen_name = s['from_user']
61
64
  status
@@ -95,7 +98,7 @@ module Termtter
95
98
  %w(id name screen_name url profile_image_url).each do |key|
96
99
  status.__send__("user_#{key}=".to_sym, s["user"][key])
97
100
  end
98
- status.text = CGI.unescapeHTML(status.text).gsub(/(\n|\r)/, '')
101
+ status.text = status.text.gsub(/(\n|\r)/, '')
99
102
  status
100
103
  end
101
104
  end
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module Termtter
3
- VERSION = '0.8.9'
3
+ VERSION = '0.8.10'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jugyo-termtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo