alienzhou / web-highlighter

✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️
https://alienzhou.github.io/web-highlighter/
MIT License
888 stars 144 forks source link

Create highlight wrapper inside another wrapper will take all the classes from parent #79

Closed ruanyl closed 3 years ago

ruanyl commented 3 years ago

Related commit 35560fa8f66bca78c7757f9975610b4cbca3cbc3

The issue I'm facing is when I create multi-color highlights, the highlight wrapper created inside another wrapper will take all the class of the parent wrapper. And this will override the color of the child wrapper if the child has a different color.

image

As you can see in the above screenshot, the highlight wrapper has both class names highlighter-color-yellow from its parent and highlighter-color-green which is the expected color of itself.

This retain the wrapper's classname is a bit odd, what's the intention of this change?

alienzhou commented 3 years ago

80