Tuesday, 15 September 2020

Looking for a lightweight way to search html

I am implementing a search feature in my app where the searchable content is an array of documents that are hydratable as an html string. Given I have a block of html content as a string, what would be the straightforward and node-ish ways to implement a simple text search of the content? By 'simple', I mean the sort of thing you get with "find in page" when in the browser. My question is really: What are the straightforward and node-ish ways to get the textcontent of an html string? However, I do want to render the result to the user in a snippet of truly rendered snippet of content.

Submitted September 15, 2020 at 09:59PM by Awnry_Abe

No comments:

Post a Comment