h
h copied to clipboard
style tag content shouldn't be highlighted\annotated
trafficstars
Steps to reproduce
- Go to this Wikipedia page (sorry it's Hebrew, but this is where I've encountered the bug).
- ctrl+f for the words המצב כך:
- With your mouse, select these words along with the first word of the next paragraph, like so:
) - The highlighted text contains the
<style>tag text:
Expected behaviour
<style> tag content shouldn't be highlighted
Actual behaviour
<style> tag content was highlighted
Browser/system information
Chrome Version 80.0.3987.163 (Official Build) (64-bit), Windows 10
Additional details
I'm not sure it's a valid fix, here's what I did on my local build inside Util.getTextNodes to fix this:
if (node.nodeType !== Util.NodeTypes.COMMENT_NODE &&
node.nodeName.toLowerCase() !== "style") // <-- added by me