mirror of
https://github.com/discourse/discourse.git
synced 2025-03-20 13:27:52 +08:00
se onebox could exception out
This commit is contained in:
parent
9e20a99afd
commit
a7eea65d53
@ -35,10 +35,12 @@ module Oneboxer
|
||||
def parse(data)
|
||||
result = JSON.parse(data)['items'].first
|
||||
|
||||
result['creation_date'] =
|
||||
Time.at(result['creation_date'].to_i).strftime("%I:%M%p - %d %b %y")
|
||||
if result
|
||||
result['creation_date'] =
|
||||
Time.at(result['creation_date'].to_i).strftime("%I:%M%p - %d %b %y")
|
||||
|
||||
result['tags'] = result['tags'].take(4).join(', ')
|
||||
result['tags'] = result['tags'].take(4).join(', ')
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
@ -47,7 +47,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
var options = []
|
||||
var options = [];
|
||||
var i;
|
||||
for (i=0; i < emoji.length; i++) {
|
||||
if (emoji[i].indexOf(term) === 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user