react-rough-notation icon indicating copy to clipboard operation
react-rough-notation copied to clipboard

Adding highlights in HTML strings

Open shashtag opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. We have HTML string coming from the backend and we need to add highlighting feature on it.

Describe the solution you'd like An api to add the highlighting to HTML strings.

Describe alternatives you've considered We have tried parsing the HTML string to React (by multiple ways - create root, react-html-parser, html-react-parser, etc) and adding the tags dynamically..

We have also added the html directly to the dom by dangerouslySetInnerHTML.

We have tried all the solutions mentioned in this stack overflow link https://stackoverflow.com/questions/36104302/how-do-i-convert-a-string-to-jsx

shashtag avatar Oct 05 '23 11:10 shashtag

Hi Shashwat,

can you add a codesandbox example with this part of your code for me to take a look? It can be very simplistic

related to adding this to HTML elements outside React, you can use the original package:

https://www.npmjs.com/package/rough-notation

My library is a react wrapper for rough-notation

linkstrifer avatar Oct 20 '23 18:10 linkstrifer