This project is archived. Its data is read-only.

whitespace padding breaks CSS selectors

When querying with CSS selectors, having whitespace before the selector:

oga_doc.css(" .test")

throws the following error:

LL::ParserError: Unexpected T_SPACE for rule 1 from /home/eiko/.rvm/gems/ruby-2.4.0-rc1/gems/ruby-ll-2.1.2/lib/ll/driver.rb:15:in `parser_error'

and having whitespace after the selector:

oga_doc.css(".test ")

throws this error:

LL::ParserError: Unexpected -1 for rule 3 from /home/eiko/.rvm/gems/ruby-2.4.0-rc1/gems/ruby-ll-2.1.2/lib/ll/driver.rb:15:in `parser_error'

I believe it would be better to ignore whitespace, as HTML, CSS and JQuery work this way, and Oga already ignores additional whitespace between selectors.

Assignee Loading
Time tracking Loading