- The public API now has nullability annotations.
- The public API now uses generics where available.
- Some default values have changed when initializing nodes via
init, in order to conform to the (now explicit) nullability annotations:HTMLCommentdefaults to adataof "" (the empty string). Previously its defaultdatawasnil.HTMLDocumentTypedefaults to anameof "html". Previously its defaultnamewasnil.HTMLElementdefaults to atagNameof "" (the empty string). Previously its defaulttagNamewasnil.
- Nullability annotations for parameters are checked using NSParameterAssert. Some methods which previously returned
nilwhen passed anilparameter will now raise an assertion error. If you get assertion errors after upgrading where you previously did not get assertion errors, this may be why. HTMLNode's-nodesMatchingSelector:,-firstNodeMatchingSelector,-nodesMatchingParsedSelector:, and-firstNodeMatchingParsedSelector:methods now always throw anNSInvalidArgumentExceptionif the selector fails to parse. Previously they would raise an assertion, but otherwise fail in other (more poorly-defined) ways.- Use angle bracket imports (
#import <HTMLReader/…>) throughout public headers, like a proper framework.
- Selectors can now include escaped characters, allowing for e.g. matching elements like
<some-ns:some-tag>using a selector likesome-ns\:some-tag. Supported escapes are\XXXXXXfor 1-6 hex digitsX, and\cfor any other characterc.
- Rename
namespaceproperties tohtmlNamespaceto support compilation as Objective-C++.
- Update build settings to allow
HTMLReader.frameworkuse in Swift on OS X.
- Remove private header
HTMLTextNode.hfrom the built framework.
- A new document initializer,
-[HTMLDocument initWithData:contentTypeHeader:], detects the character encoding as a browser would. This is the ideal initializer for HTML documents fetched over the network, or any other time when the character encoding isn't previously known. Note that HTML does not blindly use the encoding specified by the HTTPContent-Typeheader, so this initializer is still superior to parsing theContent-Typeyourself.