emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
238 stars 30 forks source link

fix: title should have default value when build doc #62

Closed IsLand-x closed 1 year ago

IsLand-x commented 1 year ago

image

Here the bug is, while building markdown block which title has special symbol and no custom anchor followed (also the /{.*?}/), the title ( also named variable t in code), will not assigned by the statement clause, and will not get a value.

As a result, while searching in the docsite, the searched items's title is slugged unexpectedly. (the blue backgrounded item)

But to meet the expect, should not slug the title. (like the red bordered item)

shadow-light commented 1 year ago

I was confused by this too. All the titles of search results were hyphenated. This fix looks good to me.

IsLand-x commented 1 year ago

@emersonbottero Review required, want to fix the bug and make it meet the expect in my project. Thanks.