I have a block of plain text, and a list of start/end offsets for things I want to highlight. For example:
Hello StackOverflow, how are you?
[
{
start: 6,
end: 19,
desc: "A website where people can get help with programming questions"
},
...
]
I want to add <span> tags into the text at the correct point, so that I can add a title onto the span with the description. Is there a library or easy approach to doing this using Javascript (specifically within the React framework, but I don't think that should make a difference).