NEWS | R Documentation |
Enabled partial matching on the translator argument to
css_to_xpath()
. Instead of defaulting to a generic translator,
a non-matching argument will be returned with an error.
Introduced many more unit tests via the covr package.
This enabled dead code to be trimmed and also identified areas of code
which needed improvement. Minor enhancements include: tolerate
whitespace within a :not()
, more consistent results returned
from parser methods, improvements to argument parsing.
The |=
attribute matching operator was not being parsed
correctly for the generic translator.
Handle scenario where a CSS comment is unclosed. Results in everything after the comment start to be removed (which may or may not result in a valid selector).
Added support for documents from the xml2 package.
selectr now also does not strictly depend on the XML
package. If either the XML or xml2 packages are
present (which are required for the querySelector
methods
to work) then querySelector
will begin to work for them.
This also enables selectr to be used for translation-only.
Improve support for nth-*(an+b) selectors. Ported from cssselect.
Code cleanup contributed by Kun Ren (#1).
Updated DESCRIPTION to include URL and BugReports fields. Also update email address.
Fix behaviour for nth-*(an+b) pseudo-class selectors for negative a's. Contributed to cssselect by Paul Tremberth, ported to R.
Escape delimiting characters to support new version of the stringr package. Probably should have been done in the first place. Reported by Hadley Wickham (#5).
Corrected licence to BSD 3 clause. This was the licence in use previously, but has now been made more explicit.
Removed 'Enhances' field because we import functions from XML. This choice is made because XML is a required package, rather than an optional package that can be worked with. This and the previous change have been made to keep up with recent changes in R-devel.
Added a 'CITATION' file which cites a technical report on the package.
show()
methods are now available on internal objects,
making interactive extensibility and bug-fixing easier. This is
simply wrapping the repr()
methods (mirroring the Python
source) that the same objects have.
Use the session character encoding to determine whether to run unicode tests. Tests break in non-unicode sessions otherwise.
Introduced new functions querySelectorNS()
and
querySelectorAllNS()
to ease the use of namespaces within a
document. Previously this would have required knowledge of XPath.
Fix meaning of :empty
, whitespace is not empty.
Use lang()
for XML documents with the :lang()
CSS selector.
|ident
no longer produces a parsing error, but is now
equivalent to just 'ident'.
Now testing unicode only in non-Windows platforms on package check. Output should still be consistent, just depends on the current charset being unicode.
Initial port of the Python 'cssselect' package. Code is very literally ported, including the test suite.
Wrapped translation functionality into a single function,
css_to_xpath()
.
Created two convenience functions, querySelector()
and
querySelectorAll()
. These mirror the behaviour of the same
functions present in a web browser. querySelector()
returns a
node, while querySelectorAll()
returns a list of nodes.