### Bug description

@jonthegeek noticed that when searching for "ht" in https://devdevguide.netlify.app/ he was redirected to a non-existing page immediately. 

I was able to reproduce the bug with a minimal example https://github.com/maelle/search-bug

In https://github.com/maelle/search-bug/blob/main/summary.qmd I added the necessary Markdown including html code for a redirect (which is something we need to explain to readers of the original book). That code is present in the search index. If you search for "ht" in https://maelle.github.io/search-bug/ you'll get redirected to https://docs.ropensci.org/%3Cpkgname%3E/ 

I'm guessing it has something to do with the code not being escaped somehow? Yes, that's a very vague guess. :sweat_smile: And a potentially very niche problem.

<details>
RStudio 2022.12.0+353 "Elsbeth Geranium" Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Ubuntu Bionic
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36
Ubuntu
</details>

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
dragonstyle
2023-02-17T12:42:50Z
maelle
bug
v1.3
closed
Search bug when the search index contains HTML code for a redirect (HTML book)
https://github.com/quarto-dev/quarto-cli/issues/4404