|
|
|
@ -8,7 +8,10 @@ json.results do
|
|
|
|
|
# json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>')
|
|
|
|
|
|
|
|
|
|
# 去除开头标点符号
|
|
|
|
|
highlights&.[](highlights.keys.first)&.sub!(/^[,。?:;‘’!“”—……、]/, '')
|
|
|
|
|
reg = /^[,。?:;‘’!“”—……、]/
|
|
|
|
|
highlights[:description]&.first&.sub!(reg, '')
|
|
|
|
|
highlights[:content]&.first&.sub!(reg, '')
|
|
|
|
|
|
|
|
|
|
json.content highlights
|
|
|
|
|
end
|
|
|
|
|
end
|