neamar / document-highlighter Goto Github PK
View Code? Open in Web Editor NEWContext-aware highlighting for search queries in HTML documents.
Context-aware highlighting for search queries in HTML documents.
Hello! I’ve just briefly looked at this project and so far it seems like one of the projects that most closely matches my needs.
However – I want to use react-rough-notation
to draw fancier highlighting, and in order to make that look alright, the highlight would have to be kept as one element, and the preexisting DOM split up.
Currently, this will be the result:
<em>Eat drink and be <strong>merry</strong></em><strong class="secondary"> for tomorrow</strong> we die
What would be really helpful, is if I could somehow configure this utility to instead produce the following output:
<em>Eat drink and be </em><HIGHLIGHT><em>merry</em> for tomorrow</HIGHLIGHT> we die
Is this something you’ve thought about at all?
Hello,
I hope you're well and everything is good for you.
To add support for Turkish characters in the document-highlighter library, you will need to modify the library's source code to handle Turkish characters properly. One way to do this is to use the u flag when creating the regular expression used by the library to search for the search query. The u flag enables Unicode character matching, which should allow the library to correctly match Turkish characters.
Here is an example of how you can modify the highlight function in the document-highlighter library to support Turkish characters:
const searchRegex = new RegExp(searchQuery, 'giu')
This will modify the regular expression used by the library to enable Unicode character matching, which should allow it to correctly highlight Turkish characters.
Thank you very much.
Best regards,
Hello,
I hope you're well and everything is good for you.
I use the document-highlighter library to highlight search results. It highlights the word when I enter it fully but does not highlight it when it is used in a word.
For example: (I'm not using dropdown part of document-highlighter.)
Thank you very much.
Best regards,
Any plans on creating a browser friendly version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.