easyops-cn / docusaurus-search-local

Offline/local search for Docusaurus v2/v3
https://easyops-cn.github.io/docusaurus-search-local/
MIT License
708 stars 90 forks source link

Regression: Search results omits HTML tags #455

Open SethFalco opened 1 month ago

SethFalco commented 1 month ago

I'm looking at upgrading Docusaurus and the plugins we're using, but I think there's a regression between v0.40.1 and v0.41.0 which degrades the search experience.

It does not handle HTML tags in content well anymore.

Our documentation contains the following:

Removes the [`<metadata>`](https://developer.mozilla.org/docs/Web/SVG/Element/metadata) element from the document.

Before (v0.40.1)

This version kept the name of the HTML element, and omitted the Markdown syntax. The result was perfect in my opinion.

After (>= v0.41.0, including v0.44.5)

This version only keeps the backticks in the Markdown, and nothing inside it.

weareoutman commented 1 month ago
image

I can't reproduce it.

According to your screenshot of after updating, the issue seems not to be related with the search plugin. It seems to be an issue with your markdown renderer.

Under the hood, we scan the generated html files to build the search index, if the markdown renders correctly, there will be no backticks in the generated html (should be <code></code> instead).