StractOrg / stract

web search done right
https://stract.com
GNU Affero General Public License v3.0
1.94k stars 43 forks source link

Do `'*'` replacement `'•'` on the frontend #108

Closed oeb25 closed 9 months ago

oeb25 commented 9 months ago

The old version of EntityIndex::best_info manipulated the text of spans without alterting the associated link offsets. To do this would be convoluted when having to consider '•', so instead we do not replace '*' with '•' any longer, but only strip the prefix of '*' and whitespace and then subtract the removed prefix length from all link offsets. When rendering the snippets on the frontend, we perform the '*' replacement since the index have been made into snippets and the text is thus free to change.