dev_cs
p31729568 5 years ago
parent a5811981b5
commit c705d92351

@ -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
Loading…
Cancel
Save