docsify icon indicating copy to clipboard operation
docsify copied to clipboard

Make search stop showing markdown and/or HTML syntax in search results

Open NoahMaizels opened this issue 5 years ago • 4 comments

Feature request

Make search stop showing markdown and/or HTML syntax in search results

What problem does this feature solve?

Showing markdown and html syntax in search results is not the expected behavior for full text search. It should return rendered text with no syntax.

What does the proposed API look like?

How should this be implemented in your opinion?

Are you willing to work on this yourself?

NoahMaizels avatar Sep 09 '20 06:09 NoahMaizels

We notice this problem also but there havnt had an ideal way to solve it yet. we may plan to use some search plugins to make it.

Koooooo-7 avatar Sep 09 '20 14:09 Koooooo-7

@noahniuwa I found out a solution, use lurn https://github.com/kiwicom/docsify-lunr-search maybe fix this problem. However, Lunr not really better current search in docsify but it can fix this problem.

ngthtung avatar Nov 04 '20 07:11 ngthtung

Anyone have leads on this issue? I am experimenting with supporting Search with Docsify-This.net and seeing this issue too - for example, search for "Welcome". https://paulhibbitts.github.io/test-docsify-this/?basePath=https://raw.githubusercontent.com/hibbitts-design/docsify-this-multiple-page-course-site/main&homepage=home.md&sidebar=true&loadSidebar=_sidebar.md&loadNavbar=_navbar.md&search=true

UPDATE: I customized the Search.js code to not include certain HTML items https://github.com/paulhibbitts/test-docsify-this/blob/main/docs/assets/vendor/docsify/plugins/custom/search.js#L228-L234

paulhibbitts avatar Jun 30 '23 16:06 paulhibbitts

These libraries look like promising options for removing markdown/HTML markup from our search results:

  • https://github.com/danestves/markdown-to-text
  • https://github.com/ejrbuss/markdown-to-txt

jhildenbiddle avatar Jun 21 '24 19:06 jhildenbiddle