mirror of
https://github.com/discourse/discourse.git
synced 2025-04-10 10:30:59 +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)
|
def parse(data)
|
||||||
result = JSON.parse(data)['items'].first
|
result = JSON.parse(data)['items'].first
|
||||||
|
|
||||||
|
if result
|
||||||
result['creation_date'] =
|
result['creation_date'] =
|
||||||
Time.at(result['creation_date'].to_i).strftime("%I:%M%p - %d %b %y")
|
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
|
result
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = []
|
var options = [];
|
||||||
var i;
|
var i;
|
||||||
for (i=0; i < emoji.length; i++) {
|
for (i=0; i < emoji.length; i++) {
|
||||||
if (emoji[i].indexOf(term) === 0) {
|
if (emoji[i].indexOf(term) === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user