Description
See vuejs/vitepress#5126
Steps to reproduce
- Go to https://vitepress.dev/
- Click on the search button
- Resize the browser to mobile viewports
- Search for layout slots
It shows like this even though there is significant space:

The API response is like this:
"_snippetResult": {
"content": {
"value": "… the theme via <mark>layout</mark> <mark>slots</mark>.",
"matchLevel": "full"
},
"hierarchy": {
"lvl1": {
"value": "Extending the Default Theme ",
"matchLevel": "none"
}
}
}
It seems to be reproducible on DocSearch's official website too. For example:

Expected behavior
The server-side truncation should consider the element width, or maybe do the truncation on client side entirely?
Environment
- OS: macOS 26.3
- Browser: Chromium 145.0.7632.110
- DocSearch version: 4.5.3
Description
See vuejs/vitepress#5126
Steps to reproduce
It shows like this even though there is significant space:
The API response is like this:
It seems to be reproducible on DocSearch's official website too. For example:
Expected behavior
The server-side truncation should consider the element width, or maybe do the truncation on client side entirely?
Environment