hypothesis / hypothesis/h

style tag content shouldn't be highlighted\annotated

Open
#6,007 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.2k
Forks
459
Avg merge
27d 1h
Merged PRs (30d)
1

Description

### Steps to reproduce
1. Go to [this Wikipedia page](https://he.wikipedia.org/wiki/%D7%94%D7%9E%D7%A8%D7%93_%D7%94%D7%92%D7%93%D7%95%D7%9C) (sorry it's Hebrew, but this is where I've encountered the bug).
2. ctrl+f for the words המצב כך:
3. With your mouse, select these words along with the first word of the next paragraph, like so:
![bug](https://user-images.githubusercontent.com/30159171/79127458-9d963280-7daa-11ea-9ffc-dabeb499288c.gif)
)
4. The highlighted text contains the `` tag text:
![image](https://user-images.githubusercontent.com/30159171/79127596-d9c99300-7daa-11ea-8dac-2b5dcd660f49.png)

### 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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.