Hey there, I'm new around here so please bear with me if this question seems basic. Could you point me in the right direction for resources?
Consider this sentence:
"This approach combines the best of both worlds."
Now let's say I want to highlight the bolded text when a user hovers over it. I know how to do that. But what about this sentence:
"Speaking of (in this case quite literally) the devil, ..."
In this instance, the important words are separated, but I still want them highlighted when hovered over. How should I structure this data in a JSON coming from the backend? Which highlights belong together and which don't?
{
sentence: [
{ word: "This",
highlight: false
},
{ word: "approach",
highlight: false
},
...
{
word: "the best of both worlds",
highlight: true
}
]
}
I'm not sure if this is the best solution. Let's say I have multiple elements in one sentence that need individual highlighting. How can I organize this data in JSON when they can't be directly grouped together?