33 Commits

Author SHA1 Message Date
iska bf0d8560b0 Merge branch 'release/2.1.4' 2018-05-01 20:08:30 +02:00
iska d29a70dfec Bump HTMLKit version to 2.1.4 2018-05-01 20:08:00 +02:00
iska b8f56ca97d Update podspec for 2.1.4 2018-05-01 20:07:44 +02:00
iska 0f954d5d56 Update jazzy.yaml for 2.1.4 2018-05-01 20:07:35 +02:00
iska ac5089d69b Add Changelog entry for HTMLKit 2.1.4 2018-05-01 20:07:23 +02:00
iska c9c36397e0 Update CocoaPods block in Readme 2018-05-01 20:02:36 +02:00
iska 923e271429 Fix eq, lt & gt selectors for the zero-index case
Fixes #25
2018-04-18 23:51:39 +02:00
iska 8546168324 Merge branch 'release/2.1.3' 2018-03-21 22:52:09 +01:00
iska da765169fa Merge branch 'release/2.1.3' into develop 2018-03-21 22:51:46 +01:00
iska ec6d03ee57 Bump HTMLKit version to 2.1.3 2018-03-21 22:43:01 +01:00
iska 7944549bd7 Update podspec for 2.1.3 2018-03-21 22:42:41 +01:00
iska bb6a97984b Update jazzy.yaml for 2.1.3 2018-03-21 22:42:32 +01:00
iska 0aff9cf787 Add Changelog entry for HTMLKit 2.1.3 2018-03-21 22:42:00 +01:00
iska b7bf9d2b04 Use HTMLOrderedDictionary when cloning element's attributes 2018-03-21 22:19:24 +01:00
iska 12af838fa2 Update html5lib-tests to latest commit as of 2018.03.18 2018-03-18 21:45:44 +01:00
iska 14b8b5390f Add test case for node deep-clone 2018-03-18 21:45:04 +01:00
Iskandar Abudiab a5599c4163 Merge pull request #23 from CRivlaldo/iterator
Fix the issue #22
2018-03-18 21:26:27 +01:00
Iskandar Abudiab c0ac25645d Merge pull request #24 from CRivlaldo/deepclone
Fix the issue #20
2018-03-18 21:19:42 +01:00
Vladimir fa431550d7 Fix the issue 22 (fix a test name) 2018-03-17 11:34:22 +03:00
Vladimir 70c6aee814 Fix the issue 22 2018-03-17 11:33:30 +03:00
Vladimir 7309b97b92 Fix the HTMLElement attributes copying 2018-03-17 10:40:00 +03:00
iska 7ffb8e5ca0 Merge branch 'release/2.1.2' into develop 2017-11-06 22:05:08 +01:00
iska 682b19c242 Merge branch 'release/2.1.2' 2017-11-06 22:05:07 +01:00
iska 16ed846e65 Bump HTMLKit version to 2.1.2 2017-11-06 22:04:57 +01:00
iska 820b3ef091 Update podspec for 2.1.2 2017-11-06 22:04:38 +01:00
iska fb7ea25b1f Update jazzy.yaml for 2.1.2 2017-11-06 22:04:29 +01:00
iska 5302c16600 Add Changelog entry for HTMLKit 2.1.2 2017-11-06 22:04:18 +01:00
iska 2dfdeb22ca Fix HTMLElement attribute value serialization
Fixes #17
2017-11-06 21:58:08 +01:00
iska 135715b606 Fix HTMLText serialization
Fixes #16
2017-11-06 21:55:41 +01:00
iska f8e6a39171 Merge branch 'hotfix/2.1.1' into develop 2017-10-13 23:05:31 +02:00
iska 84960e71ee Enable warnings for missing function prototypes and fix present error 2017-10-13 22:54:30 +02:00
iska 7b028a2819 Enable warnings for documentation comments and fix present errors 2017-10-13 22:48:16 +02:00
iska 5aa77eac9b Merge branch 'release/2.1.0' into develop 2017-10-12 22:44:50 +02:00
28 changed files with 275 additions and 42 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
module: HTMLKit
module_version: 2.1.1
module_version: 2.1.4
author: Iskandar Abudiab
author_url: https://twitter.com/iabudiab
github_url: https://github.com/iabudiab/HTMLKit
+31
View File
@@ -1,5 +1,36 @@
# Change Log
## [2.1.4](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.4)
Released on 2018.05.01
### Fixes
- `gt(n)`, `lt(n)` and `eq(n)` selectors would select wrong elements for the zero-index (issue #25)
## [2.1.3](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.3)
Released on 2018.03.21
### Fixes
- `HTMLElement` clone would return an immutable dictionary for attributes (issue #20)
- Fixed by @CRivlaldo in PR #24
- `HTMLNodeFilterBlock` would behave differently on simulator and device (issue #22)
- Fixed by @CRivlaldo in PR #23
## [2.1.2](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.2)
Released on 2017.11.6
### Fixes
- `HTMLText` serialization (issue #16)
- `HTMLElement` attribute value serialization (issue #17)
## [2.1.1](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.1)
Released on 2017.10.13
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "HTMLKit"
s.version = "2.1.1"
s.version = "2.1.4"
s.summary = "HTMLKit, an Objective-C framework for your everyday HTML needs."
s.license = "MIT"
s.homepage = "https://github.com/iabudiab/HTMLKit"
+40
View File
@@ -11,6 +11,9 @@
62056C501E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
62056C511E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
62056C521E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
620AB7B12087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */ = {isa = PBXBuildFile; fileRef = 620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */; };
620AB7B22087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */ = {isa = PBXBuildFile; fileRef = 620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */; };
620AB7B32087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */ = {isa = PBXBuildFile; fileRef = 620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */; };
62132E5A1C01F83200084175 /* CSSSelectorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 62132E581C01F83200084175 /* CSSSelectorTest.m */; };
62132E5D1C021FF200084175 /* css-tests in Resources */ = {isa = PBXBuildFile; fileRef = 62132E5B1C021FF200084175 /* css-tests */; };
6216ACFD1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6216ACFC1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m */; };
@@ -306,6 +309,9 @@
62857D8F1D39A47F008DC254 /* CSSCombinatorSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 62FA04E11BCC360D009ABF98 /* CSSCombinatorSelector.h */; settings = {ATTRIBUTES = (Public, ); }; };
62857D901D39A47F008DC254 /* CSSCompoundSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 620C87791BD44CBE00FB3EEE /* CSSCompoundSelector.h */; settings = {ATTRIBUTES = (Public, ); }; };
628AF6301BC99A6C00496128 /* CSSNthExpressionsParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 628AF62E1BC99A6C00496128 /* CSSNthExpressionsParserTests.m */; };
62A95A4D1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */; };
62A95A4E1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */; };
62A95A4F1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */; };
62D8345A19FB1AC4009205A9 /* HTML5LibTokenizerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 62D8345819FB1AC4009205A9 /* HTML5LibTokenizerTest.m */; };
62D91C231DE218A500BEFADE /* HTMLRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D91C211DE218A500BEFADE /* HTMLRange.h */; settings = {ATTRIBUTES = (Public, ); }; };
62D91C241DE218A500BEFADE /* HTMLRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D91C211DE218A500BEFADE /* HTMLRange.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -581,6 +587,7 @@
/* Begin PBXFileReference section */
62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLNodeIterator+Private.h"; path = "include/HTMLNodeIterator+Private.h"; sourceTree = "<group>"; };
62079BE71AF56F1E00D3B402 /* CSSSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSSelector.h; path = include/CSSSelector.h; sourceTree = "<group>"; };
620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CSSStructuralPseudoSelectors.m; path = HTMLKitTests/CSSStructuralPseudoSelectors.m; sourceTree = "<group>"; };
620C87791BD44CBE00FB3EEE /* CSSCompoundSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSCompoundSelector.h; path = include/CSSCompoundSelector.h; sourceTree = "<group>"; };
620C877A1BD44CBE00FB3EEE /* CSSCompoundSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSCompoundSelector.m; sourceTree = "<group>"; };
620EE9471BC46F2A0028ED34 /* CSSPseudoClassSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSPseudoClassSelector.h; path = include/CSSPseudoClassSelector.h; sourceTree = "<group>"; };
@@ -703,6 +710,7 @@
628AF63C1BC9D6FB00496128 /* CSSStructuralPseudoSelectors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSStructuralPseudoSelectors.h; path = include/CSSStructuralPseudoSelectors.h; sourceTree = "<group>"; };
628AF63D1BC9D6FB00496128 /* CSSStructuralPseudoSelectors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSStructuralPseudoSelectors.m; sourceTree = "<group>"; };
628B7CE61A080E1000602C87 /* HTMLNamespaces.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLNamespaces.h; path = include/HTMLNamespaces.h; sourceTree = "<group>"; };
62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTMLSerializationTests.m; path = HTMLKitTests/HTMLSerializationTests.m; sourceTree = "<group>"; };
62ACB8DB1BC5C13E00E283C1 /* CSSPseudoFunctionSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSPseudoFunctionSelector.h; path = include/CSSPseudoFunctionSelector.h; sourceTree = "<group>"; };
62ACB8DC1BC5C13E00E283C1 /* CSSPseudoFunctionSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSPseudoFunctionSelector.m; sourceTree = "<group>"; };
62AE593319F97D880043F069 /* HTMLParseErrorToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParseErrorToken.h; path = include/HTMLParseErrorToken.h; sourceTree = "<group>"; };
@@ -885,6 +893,7 @@
62EC7AE51AEEAC6F0015D3BE /* HTMLMutationAlgorithmsTests.m */,
62EC0A841E158BD80007786B /* HTMLRangeTests.m */,
62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */,
62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */,
);
name = DOM;
sourceTree = "<group>";
@@ -1139,6 +1148,7 @@
624AB3191B050A4D00F3830D /* CSSAttributeSelectorTests.m */,
62F6586F1BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m */,
621FBE5C1BDAD90200BC9555 /* CSSCombinatorSelectorTests.m */,
620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */,
);
name = Selectors;
sourceTree = "<group>";
@@ -1745,6 +1755,7 @@
buildActionMask = 2147483647;
files = (
62EC0A851E158BD80007786B /* HTMLRangeTests.m in Sources */,
620AB7B12087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */,
62E0BA971E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */,
6216ACFD1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m in Sources */,
62132E5A1C01F83200084175 /* CSSSelectorTest.m in Sources */,
@@ -1761,6 +1772,7 @@
62567F561C0CC3AE0025D458 /* HTMLDOMTokenListTests.m in Sources */,
624AC90219FBF9ED00BD3C4A /* HTMLKitTokenizerTests.m in Sources */,
624B9FB31AE0313300646C4C /* HTMLStringCategoryTests.m in Sources */,
62A95A4D1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */,
623916C81AC7209E0066B4FE /* HTMLNodeIteratorTests.m in Sources */,
62D8345A19FB1AC4009205A9 /* HTML5LibTokenizerTest.m in Sources */,
6239755F1AC364BB007E26F1 /* HTML5LibTreeConstructionTest.m in Sources */,
@@ -1887,6 +1899,7 @@
buildActionMask = 2147483647;
files = (
62EC0A871E158BD80007786B /* HTMLRangeTests.m in Sources */,
620AB7B32087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */,
62E0BA991E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */,
62857D3B1D39A345008DC254 /* CSSSelectorTest.m in Sources */,
62857D421D39A345008DC254 /* CSSCombinatorSelectorTests.m in Sources */,
@@ -1903,6 +1916,7 @@
62857D401D39A345008DC254 /* CSSAttributeSelectorTests.m in Sources */,
62857D311D39A33C008DC254 /* HTML5LibTreeConstructionTest.m in Sources */,
62857D391D39A342008DC254 /* HTMLOrderedDictionaryTests.m in Sources */,
62A95A4F1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */,
62857D411D39A345008DC254 /* CSSNThExpressionSelectorTests.m in Sources */,
62857D381D39A342008DC254 /* HTMLStringCategoryTests.m in Sources */,
62857D331D39A33C008DC254 /* HTMLKitParserPerformance.m in Sources */,
@@ -1974,6 +1988,7 @@
buildActionMask = 2147483647;
files = (
62EC0A861E158BD80007786B /* HTMLRangeTests.m in Sources */,
620AB7B22087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */,
62E0BA981E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */,
6216ACFE1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m in Sources */,
62ECBFCA1C0B6E2E00AF847B /* HTML5LibTokenizerTest.m in Sources */,
@@ -1990,6 +2005,7 @@
62567F571C0CC3AE0025D458 /* HTMLDOMTokenListTests.m in Sources */,
62ECBFD41C0B6E2E00AF847B /* HTMLStringCategoryTests.m in Sources */,
62ECBFD51C0B6E2E00AF847B /* HTMLOrderedDictionaryTests.m in Sources */,
62A95A4E1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */,
62ECBFD61C0B6E2E00AF847B /* CSSSelectorTest.m in Sources */,
62ECBFD71C0B6E2E00AF847B /* CSSSelectorParserTests.m in Sources */,
62ECBFD81C0B6E2E00AF847B /* CSSNthExpressionsParserTests.m in Sources */,
@@ -2118,6 +2134,7 @@
625A14D519C7829400AD0C32 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -2127,8 +2144,10 @@
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "@rpath";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2143,6 +2162,7 @@
625A14D619C7829400AD0C32 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -2152,8 +2172,10 @@
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "@rpath";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2218,6 +2240,7 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
@@ -2229,7 +2252,9 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2253,6 +2278,7 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
COPY_PHASE_STRIP = NO;
@@ -2264,7 +2290,9 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2288,6 +2316,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer";
@@ -2301,7 +2330,9 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2323,6 +2354,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer";
@@ -2336,7 +2368,9 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2399,6 +2433,7 @@
62ECBF5F1C0B6C7600AF847B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
@@ -2411,8 +2446,10 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
GCC_WARN_PEDANTIC = NO;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
@@ -2435,6 +2472,7 @@
62ECBF601C0B6C7600AF847B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
@@ -2447,8 +2485,10 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
GCC_WARN_PEDANTIC = NO;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
+3 -5
View File
@@ -4,8 +4,8 @@
An Objective-C framework for your everyday HTML needs.
[![Build Status](https://img.shields.io/travis/iabudiab/HTMLKit/master.svg?style=flat)](https://travis-ci.org/iabudiab/HTMLKit)
[![codecov](https://codecov.io/gh/iabudiab/HTMLKit/branch/master/graph/badge.svg)](https://codecov.io/gh/iabudiab/HTMLKit)
[![Build Status](https://img.shields.io/travis/iabudiab/HTMLKit/develop.svg?style=flat)](https://travis-ci.org/iabudiab/HTMLKit)
[![codecov](https://codecov.io/gh/iabudiab/HTMLKit/branch/develop/graph/badge.svg)](https://codecov.io/gh/iabudiab/HTMLKit)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/HTMLKit.svg?style=flat)](https://cocoapods.org/pods/HTMLKit)
[![CocoaDocs](https://img.shields.io/cocoapods/metrics/doc-percent/HTMLKit.svg?style=flat)](http://cocoadocs.org/docsets/HTMLKit)
@@ -76,10 +76,8 @@ $ gem install cocoapods
To add `HTMLKit` as a dependency into your project using CocoaPods just add the following in your `Podfile`:
```ruby
use_frameworks!
target 'MyTarget' do
pod 'HTMLKit', '~> 2.0'
pod 'HTMLKit', '~> 2.1'
end
```
+1 -1
View File
@@ -38,7 +38,7 @@ NSString * _Nonnull NSStringFromNthExpression(CSSNthExpression expression)
#pragma mark - Implementation
NSInteger computeIndex(NSEnumerator *enumerator, HTMLElement *element)
NS_INLINE NSInteger computeIndex(NSEnumerator *enumerator, HTMLElement *element)
{
NSInteger index = 0;
for (HTMLNode *node in enumerator) {
+3 -3
View File
@@ -276,7 +276,7 @@ CSSSelector * ltSelector(NSInteger index)
return namedBlockSelector(name, ^BOOL(HTMLElement * _Nonnull element) {
NSUInteger elementIndex = [element.parentElement indexOfChildNode:element];
if (index > 0) {
if (index >= 0) {
return elementIndex < index;
} else {
return elementIndex < element.parentElement.childNodesCount - index - 1;
@@ -290,7 +290,7 @@ CSSSelector * gtSelector(NSInteger index)
return namedBlockSelector(name, ^BOOL(HTMLElement * _Nonnull element) {
NSUInteger elementIndex = [element.parentElement indexOfChildNode:element];
if (index > 0) {
if (index >= 0) {
return elementIndex > index;
} else {
return elementIndex > element.parentElement.childNodesCount - index - 1;
@@ -304,7 +304,7 @@ CSSSelector * eqSelector(NSInteger index)
return namedBlockSelector(name, ^BOOL(HTMLElement * _Nonnull element) {
NSUInteger elementIndex = [element.parentElement indexOfChildNode:element];
if (index > 0) {
if (index >= 0) {
return elementIndex == index;
} else {
return elementIndex == element.parentElement.childNodesCount - index - 1;
+4 -5
View File
@@ -144,7 +144,7 @@
{
HTMLElement *copy = [super copyWithZone:zone];
copy->_tagName = [_tagName copy];
copy->_attributes = [_attributes copy];
copy->_attributes = [_attributes mutableCopy];
copy->_htmlNamespace = _htmlNamespace;
return copy;
}
@@ -157,11 +157,10 @@
[result appendFormat:@"<%@", self.tagName];
[self.attributes enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
NSRange range = NSMakeRange(0, value.length);
NSMutableString *escaped = [value mutableCopy];
[escaped replaceOccurrencesOfString:@"&" withString:@"&amp;" options:0 range:range];
[escaped replaceOccurrencesOfString:@"\00A0" withString:@"&nbsp;" options:0 range:range];
[escaped replaceOccurrencesOfString:@"\"" withString:@"&quot;" options:0 range:range];
[escaped replaceOccurrencesOfString:@"&" withString:@"&amp;" options:0 range:NSMakeRange(0, escaped.length)];
[escaped replaceOccurrencesOfString:@"0x00A0" withString:@"&nbsp;" options:0 range:NSMakeRange(0, escaped.length)];
[escaped replaceOccurrencesOfString:@"\"" withString:@"&quot;" options:0 range:NSMakeRange(0, escaped.length)];
[result appendFormat:@" %@=\"%@\"", key, escaped];
}];
+1 -1
View File
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<string>2.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+1 -1
View File
@@ -15,7 +15,7 @@
@interface HTMLNodeFilterBlock ()
{
BOOL (^ _block)(HTMLNode *);
HTMLNodeFilterValue (^ _block)(HTMLNode *);
}
@end
+7
View File
@@ -154,4 +154,11 @@
return [_keys countByEnumeratingWithState:state objects:buffer count:len];
}
#pragma mark - Copying
- (id)mutableCopy
{
return [[HTMLOrderedDictionary alloc] initWithDictionary:self];
}
@end
+4 -5
View File
@@ -74,12 +74,11 @@ NS_INLINE void CheckValidOffset(HTMLNode *node, NSUInteger offset, NSString *cmd
@"plaintext", @"noscript", nil]) {
return self.data;
} else {
NSRange range = NSMakeRange(0, self.data.length);
NSMutableString *escaped = [self.data mutableCopy];
[escaped replaceOccurrencesOfString:@"&" withString:@"&amp;" options:0 range:range];
[escaped replaceOccurrencesOfString:@"\00A0" withString:@"&nbsp;" options:0 range:range];
[escaped replaceOccurrencesOfString:@"<" withString:@"&lt;" options:0 range:range];
[escaped replaceOccurrencesOfString:@">" withString:@"&gt;" options:0 range:range];
[escaped replaceOccurrencesOfString:@"&" withString:@"&amp;" options:0 range:NSMakeRange(0, escaped.length)];
[escaped replaceOccurrencesOfString:@"\00A0" withString:@"&nbsp;" options:0 range:NSMakeRange(0, escaped.length)];
[escaped replaceOccurrencesOfString:@"<" withString:@"&lt;" options:0 range:NSMakeRange(0, escaped.length)];
[escaped replaceOccurrencesOfString:@">" withString:@"&gt;" options:0 range:NSMakeRange(0, escaped.length)];
return escaped;
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initializes and returns a CSS has-descendant selector, e.g. 'div:has(p)'
@discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element.
@discussion 'div:has(p)' matches all &lt;div&gt; elements which have a descendant &lt;p&gt; element.
@param selector The selector matching a descendant element.
@return A new instance of the has-descendant selector.
+1 -1
View File
@@ -76,7 +76,7 @@ extern NSString * _Nonnull NSStringFromNthExpression(CSSNthExpression expression
@param string The selector string which will be parsed.
@return A new instance of a parsed CSS Selector, `nil` if the string is not a valid selector string.
*/
+ (nullable instancetype)selectorWithString:(NSString *)stirng;
+ (nullable instancetype)selectorWithString:(NSString *)string;
/**
Implementations should override this method to provide the selector-sprecific logic for matching elements.
+1 -1
View File
@@ -225,7 +225,7 @@ extern CSSSelector * not(CSSSelector *selector);
/**
CSS has-descendant selector, e.g. 'div:has(p)'
@discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element.
@discussion 'div:has(p)' matches all &lt;div&gt; elements which have a descendant &lt;p&gt; element.
@param selector The selector matching a descendant element.
@return A has-descendant selector.
+1 -1
View File
@@ -24,7 +24,7 @@
/**
Initializes a new comment token.
@param string The string with which to initialize the token.
@param data The string with which to initialize the token.
@return A new instance of a comment token.
*/
- (instancetype)initWithData:(NSString *)data;
+2
View File
@@ -24,3 +24,5 @@
#import "HTMLKitDOMExceptions.h"
#import "HTMLNamespaces.h"
#import "HTMLQuirksMode.h"
#import "HTMLOrderedDictionary.h"
+5 -5
View File
@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initializes a new HTML element with the given tag name.
@param tagname The tag name.
@param tagName The tag name.
@return A new HTML element.
*/
- (instancetype)initWithTagName:(NSString *)tagName;
@@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initializes a new HTML element with the given tag name and attributes.
@param tagname The tag name.
@param tagName The tag name.
@param attributes The attributes.
@return A new HTML element.
*/
@@ -80,8 +80,8 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initializes a new HTML element with the given tag name, namespace, and attributes.
@param tagname The tag name.
@param namespace The namespace.
@param tagName The tag name.
@param htmlNamespace The HTML namespace.
@param attributes The attributes.
@return A new HTML element.
*/
@@ -107,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN
Set the value of the attribute with the given name.
@param value The value to set.
@param name The attribute's name.
@param attribute The attribute's name.
*/
- (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute;
+2 -1
View File
@@ -15,7 +15,8 @@
/**
Typedef for the error callback block.
@param reason The string describing the reason of the reported error.
@param code The standarized error-code
@param details The string describing the reason of the reported error.
*/
typedef void (^ HTMLStreamReaderErrorCallback)(NSString *code, NSString *details);
+2 -2
View File
@@ -232,7 +232,7 @@ typedef NS_OPTIONS(unsigned short, HTMLDocumentPosition)
/**
Returns the index of the given child element in the set of child nodes.
@param node The element.
@param element The element.
@return The index of the given element in the children set.
*/
- (NSUInteger)indexOfChildElement:(HTMLElement *)element;
@@ -248,7 +248,7 @@ typedef NS_OPTIONS(unsigned short, HTMLDocumentPosition)
/**
Prepends the given array of nodes to the set of child nodes.
@param node The nodes to prepend.
@param nodes The nodes to prepend.
*/
- (void)prependNodes:(NSArray<HTMLNode *> *)nodes;
+4 -4
View File
@@ -113,16 +113,16 @@ typedef NS_ENUM(unsigned short, HTMLRangeComparisonMethod)
/**
Sets the start boundary.
@param startNode The new node of the start boundary.
@param startOffset The new offset of the start boundary.
@param node The new node of the start boundary.
@param offset The new offset of the start boundary.
*/
- (void)setStartNode:(HTMLNode *)node startOffset:(NSUInteger)offset;
/**
Sets the end boundary.
@param startNode The new node of the end boundary.
@param startOffset The new offset of the end boundary.
@param node The new node of the end boundary.
@param offset The new offset of the end boundary.
*/
- (void)setEndNode:(HTMLNode *)node endOffset:(NSUInteger)offset;
+1 -1
View File
@@ -79,7 +79,7 @@
/**
Checks whether an element with the given tag name is in the stack.
@param tagname The element's tag name.
@param tagName The element's tag name.
@return `YES` if such an element is in the stack, `NO` otherwise.
*/
- (BOOL)containsElementWithTagName:(NSString *)tagName;
-1
View File
@@ -49,7 +49,6 @@ NS_ASSUME_NONNULL_BEGIN
Initializes a new tree walker with no filter and HTMLNodeFilterShowAll show options.
@param node The root node.
@param filter The node filter to use.
@return A new instance of a tree walker.
*/
- (instancetype)initWithNode:(HTMLNode *)node;
@@ -0,0 +1,41 @@
//
// CSSStructuralPseudoSelectors.m
// HTMLKit
//
// Created by Iska on 18.04.18.
// Copyright © 2018 BrainCookie. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "CSSSelectors.h"
#import "HTMLParser.h"
#import "HTMLDOM.h"
@interface CSSStructuralPseudoSelectors : XCTestCase
@end
@implementation CSSStructuralPseudoSelectors
#pragma mark - Bug Fixes
- (void)testBugFix_Issue_25
{
NSString *html = @"<table><tr><td>TD #0</td><td>TD #1</td><td>TD #2</td><td>TD #3</td></tr></table>";
HTMLDocument *doc = [HTMLDocument documentWithString:html];
NSArray<HTMLElement *> *elements = [doc querySelectorAll:@"td:gt(0)"];
XCTAssertEqual(elements.count, 3);
XCTAssertEqualObjects(elements[0].textContent, @"TD #1");
XCTAssertEqualObjects(elements[1].textContent, @"TD #2");
XCTAssertEqualObjects(elements[2].textContent, @"TD #3");
elements = [doc querySelectorAll:@"td:lt(0)"];
XCTAssertEqual(elements.count, 0);
elements = [doc querySelectorAll:@"td:eq(0)"];
XCTAssertEqual(elements.count, 1);
XCTAssertEqualObjects(elements[0].textContent, @"TD #0");
}
@end
@@ -592,4 +592,20 @@ static HTMLNode * (^ LastDescendant)(HTMLNode *) = ^ HTMLNode * (HTMLNode *node)
XCTAssertEqual(0, nodeIterators.count);
}
- (void)testBugFix_Issue_22 {
// The issue is applicable only for devices. On simulator the test is passed.
HTMLDocument *document = [HTMLDocument documentWithString:@"<div id=\"id\"></div>"];
NSString *divId = @"id";
HTMLNodeFilterBlock *filter = [HTMLNodeFilterBlock filterWithBlock:^HTMLNodeFilterValue(HTMLNode * _Nonnull node) {
HTMLElement *element = (HTMLElement *)node;
return [element.elementId isEqualToString:divId] ? HTMLNodeFilterAccept : HTMLNodeFilterSkip;
}];
HTMLNodeIterator *iterator = [document nodeIteratorWithShowOptions:HTMLNodeFilterShowElement filter:filter];
HTMLElement *element = (HTMLElement*)iterator.nextObject;
XCTAssertTrue([element.elementId isEqualToString:divId]);
}
@end
+56
View File
@@ -512,4 +512,60 @@
XCTAssertTrue([image compareDocumentPositionWithNode:outerDiv] == (HTMLDocumentPositionContainedBy | HTMLDocumentPositionFollowing));
}
- (void)testDeepCloneElement {
HTMLElement *outer = [[HTMLElement alloc] initWithTagName:@"div"
attributes:@{@"id": @"outer",
@"class": @"green"}];
HTMLElement *innerLevel1 = [[HTMLElement alloc] initWithTagName:@"div"
attributes:@{@"id": @"inner1",
@"class": @"red"}];
HTMLElement *innerLevel2 = [[HTMLElement alloc] initWithTagName:@"div"
attributes:@{@"id": @"inner2",
@"class": @"red"}];
[outer appendNode:innerLevel1];
[innerLevel1 appendNode:innerLevel2];
HTMLElement *clone = [outer cloneNodeDeep:YES];
XCTAssertNotEqual(clone, outer);
XCTAssertEqualObjects(clone.elementId, outer.elementId);
XCTAssertEqualObjects(clone.attributes, outer.attributes);
XCTAssertNotEqual(clone.firstChild, innerLevel1);
XCTAssertEqualObjects(clone.firstChild.asElement.elementId, innerLevel1.elementId);
XCTAssertEqualObjects(clone.firstChild.asElement.attributes, innerLevel1.attributes);
XCTAssertNotEqual(clone.firstChild, innerLevel2);
XCTAssertEqualObjects(clone.firstChild.firstChild.asElement.elementId, innerLevel2.elementId);
XCTAssertEqualObjects(clone.firstChild.firstChild.asElement.attributes, innerLevel2.attributes);
}
- (void)testDeepCloneElementAttributes {
HTMLElement *div = [[HTMLElement alloc] initWithTagName:@"div"
attributes:@{@"id": @"outer",
@"class": @"green",
@"data": @"test"}];
HTMLElement *clone = [div cloneNodeDeep:YES];
XCTAssertEqualObjects(clone.attributes, div.attributes);
XCTAssertTrue([clone.attributes isKindOfClass:[HTMLOrderedDictionary class]]);
}
#pragma mark - Bug Fixes
- (void)testBugFix_Issue_20 {
HTMLElement *element = [HTMLElement new];
element.elementId = @"originalId";
HTMLElement *clone = [element cloneNodeDeep:YES];
NSString *cloneId = @"cloneId";
clone.elementId = cloneId;
XCTAssertTrue([clone.elementId isEqualToString:cloneId]);
}
@end
@@ -0,0 +1,44 @@
//
// HTMLSerializationTests.m
// HTMLKit
//
// Created by Iska on 06.11.17.
// Copyright © 2017 BrainCookie. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "HTMLDOM.h"
@interface HTMLSerializationTests : XCTestCase
@end
@implementation HTMLSerializationTests
- (void)setUp {
[super setUp];
}
- (void)tearDown {
[super tearDown];
}
#pragma mark - Bug Fixes
- (void)testBugFix_Issue_16
{
NSString *html = @"<body><div>&lt;test&gt;</div></body>";
HTMLDocument *document = [HTMLDocument documentWithString:html];
XCTAssertEqualObjects(document.body.outerHTML, html);
}
- (void)testBugFix_Issue_17
{
NSString *html = @"<body key='& testing 0x00A0'></body>";
HTMLDocument *document = [HTMLDocument documentWithString:html];
XCTAssertEqualObjects(document.body.outerHTML, @"<body key=\"&amp; testing &nbsp;\"></body>");
}
@end