Description
Both TreeDom.select() and TreeDom.select_one() failed to match any selector having the :has() pseudo-class. Because the selector parser accepts this class, this is likely to be a bug.
How to produce
Run the following code:
import markupever
html_content = """
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<div><span>Text 1</span></div>
<div><span class="target">Text 2</span></div>
<div><span>Text 3</span></div>
<div><span class="target">Text 4</span></div>
</body>
</html>
"""
tree_dom = markupever.parse(html_content, "html")
print("# Start test")
for elem in list(tree_dom.select("div:has(.target)")):
print(elem.text())
print("# End test")
Expected behaviours
The above code should print:
# Start test
Text 2
Text 4
# End test
Actual behaviours
The above code only print:
Other information
- Python version: 3.11.3
- markupever version: 0.3.3
Description
Both
TreeDom.select()andTreeDom.select_one()failed to match any selector having the:has()pseudo-class. Because the selector parser accepts this class, this is likely to be a bug.How to produce
Run the following code:
Expected behaviours
The above code should print:
Actual behaviours
The above code only print:
Other information