GravityPDF / querypath

A fork of QueryPath: a PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP8.3 support
Other
21 stars 2 forks source link

Tilde (~) attribute selector not working #13

Closed jakejackson1 closed 1 year ago

jakejackson1 commented 1 year ago

From querypath created by untoreh: technosophos/querypath#176

html5qp($html, '[attr~="anything"]'); bug: Selects elements that have the specified attribute containing any value. expected: Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.

example: qp($html, '[rel~="icon"]'); should return elements containing something like rel="icon" or rel="value icon" etc... instead it returns the first element with a rel attribute, which happens to be a stylesheet.