Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
iabudiab committed Mar 28, 2019
2 parents d756fc4 + 918c59e commit 70eeecb
Show file tree
Hide file tree
Showing 27 changed files with 195 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module: HTMLKit
module_version: 2.1.5
module_version: 3.0.0
author: Iskandar Abudiab
author_url: https://twitter.com/iabudiab
github_url: https://github.com/iabudiab/HTMLKit
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [3.0.0](https://github.com/iabudiab/HTMLKit/releases/tag/3.0.0)

Released on 2019.03.28

### Breaking Change

- Introduce prefix for `NSString` and `NSCharacterSet` categories to prevent collision with existing code (issue #35)


## [2.1.5](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.5)

Released on 2018.07.16
Expand Down
2 changes: 1 addition & 1 deletion HTMLKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "HTMLKit"
s.version = "2.1.5"
s.version = "3.0.0"
s.summary = "HTMLKit, an Objective-C framework for your everyday HTML needs."
s.license = "MIT"
s.homepage = "https://github.com/iabudiab/HTMLKit"
Expand Down
30 changes: 30 additions & 0 deletions HTMLKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@
625A14B019C7829400AD0C32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 625A14AF19C7829400AD0C32 /* Cocoa.framework */; };
625A14C519C7829400AD0C32 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 625A14C419C7829400AD0C32 /* XCTest.framework */; };
625A14C919C7829400AD0C32 /* HTMLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 625A14AC19C7829400AD0C32 /* HTMLKit.framework */; };
625A67C9224AC62C00C6D57D /* NSString+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 625A67C7224AC62C00C6D57D /* NSString+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
625A67CA224AC62C00C6D57D /* NSString+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 625A67C7224AC62C00C6D57D /* NSString+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
625A67CB224AC62C00C6D57D /* NSString+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 625A67C7224AC62C00C6D57D /* NSString+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
625A67CC224AC62C00C6D57D /* NSString+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 625A67C7224AC62C00C6D57D /* NSString+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
625A67CD224AC62C00C6D57D /* NSString+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67C8224AC62C00C6D57D /* NSString+Private.m */; };
625A67CE224AC62C00C6D57D /* NSString+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67C8224AC62C00C6D57D /* NSString+Private.m */; };
625A67CF224AC62C00C6D57D /* NSString+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67C8224AC62C00C6D57D /* NSString+Private.m */; };
625A67D0224AC62C00C6D57D /* NSString+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67C8224AC62C00C6D57D /* NSString+Private.m */; };
625A67D2224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67D1224ADC7700C6D57D /* HTMLQuircksMode.m */; };
625A67D3224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67D1224ADC7700C6D57D /* HTMLQuircksMode.m */; };
625A67D4224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67D1224ADC7700C6D57D /* HTMLQuircksMode.m */; };
625A67D5224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 625A67D1224ADC7700C6D57D /* HTMLQuircksMode.m */; };
625D0F031C2717DE00D7BEB0 /* HTMLNode+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 625D0F011C2717DE00D7BEB0 /* HTMLNode+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
625D0F041C2717DE00D7BEB0 /* HTMLNode+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 625D0F011C2717DE00D7BEB0 /* HTMLNode+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
625EE4571CBAA41D00F2CC8E /* HTMLKitTestObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 625EE4561CBAA41D00F2CC8E /* HTMLKitTestObserver.m */; };
Expand Down Expand Up @@ -692,6 +704,9 @@
625A14DF19C7834100AD0C32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
625A150619C78ABA00AD0C32 /* HTMLInputStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLInputStreamReader.h; path = include/HTMLInputStreamReader.h; sourceTree = "<group>"; };
625A150719C78ABA00AD0C32 /* HTMLInputStreamReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLInputStreamReader.m; sourceTree = "<group>"; };
625A67C7224AC62C00C6D57D /* NSString+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSString+Private.h"; path = "include/NSString+Private.h"; sourceTree = "<group>"; };
625A67C8224AC62C00C6D57D /* NSString+Private.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Private.m"; sourceTree = "<group>"; };
625A67D1224ADC7700C6D57D /* HTMLQuircksMode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HTMLQuircksMode.m; sourceTree = "<group>"; };
625D0F011C2717DE00D7BEB0 /* HTMLNode+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLNode+Private.h"; path = "include/HTMLNode+Private.h"; sourceTree = "<group>"; };
625EE4551CBAA41D00F2CC8E /* HTMLKitTestObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLKitTestObserver.h; path = HTMLKitTests/HTMLKitTestObserver.h; sourceTree = "<group>"; };
625EE4561CBAA41D00F2CC8E /* HTMLKitTestObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitTestObserver.m; path = HTMLKitTests/HTMLKitTestObserver.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -872,6 +887,7 @@
6238C9841AB8D6330006512E /* HTMLKitDOMExceptions.m */,
628B7CE61A080E1000602C87 /* HTMLNamespaces.h */,
623719431AA12EE8002E03C8 /* HTMLQuirksMode.h */,
625A67D1224ADC7700C6D57D /* HTMLQuircksMode.m */,
625D0F071C2717E400D7BEB0 /* Private */,
);
name = DOM;
Expand Down Expand Up @@ -1055,6 +1071,8 @@
628E16ED1ADAE73700B15A06 /* Categories */ = {
isa = PBXGroup;
children = (
625A67C7224AC62C00C6D57D /* NSString+Private.h */,
625A67C8224AC62C00C6D57D /* NSString+Private.m */,
6235CE991AA509430026937B /* NSString+HTMLKit.h */,
6235CE9A1AA509430026937B /* NSString+HTMLKit.m */,
624B28C21B04190D0048D328 /* NSCharacterSet+HTMLKit.h */,
Expand Down Expand Up @@ -1189,6 +1207,7 @@
62ECBEEA1C0B69FD00AF847B /* HTMLCommentToken.h in Headers */,
62ECBEEB1C0B69FD00AF847B /* HTMLDOCTYPEToken.h in Headers */,
626BE1E21DF3819500C49514 /* HTMLDOMUtils.h in Headers */,
625A67C9224AC62C00C6D57D /* NSString+Private.h in Headers */,
62ECBEEC1C0B69FD00AF847B /* HTMLParseErrorToken.h in Headers */,
62ECBEED1C0B69FD00AF847B /* HTMLTagToken.h in Headers */,
62ECBEEE1C0B69FD00AF847B /* HTMLEOFToken.h in Headers */,
Expand Down Expand Up @@ -1262,6 +1281,7 @@
62857C841D398917008DC254 /* HTMLParser.h in Headers */,
62857CDB1D3989CE008DC254 /* CSSAttributeSelector.h in Headers */,
62857C791D398907008DC254 /* HTMLEOFToken.h in Headers */,
625A67CC224AC62C00C6D57D /* NSString+Private.h in Headers */,
626BE1E51DF3819500C49514 /* HTMLDOMUtils.h in Headers */,
62857CC41D3989A9008DC254 /* CSSSelectors.h in Headers */,
62857C731D398907008DC254 /* HTMLToken.h in Headers */,
Expand Down Expand Up @@ -1335,6 +1355,7 @@
62857D4E1D39A40A008DC254 /* HTMLTokenizerCharacters.h in Headers */,
62857D4D1D39A40A008DC254 /* HTMLTokenizerStates.h in Headers */,
62857D501D39A411008DC254 /* HTMLTokens.h in Headers */,
625A67CB224AC62C00C6D57D /* NSString+Private.h in Headers */,
626BE1E41DF3819500C49514 /* HTMLDOMUtils.h in Headers */,
62857D7B1D39A452008DC254 /* HTMLNamespaces.h in Headers */,
62857D581D39A416008DC254 /* HTMLParser.h in Headers */,
Expand Down Expand Up @@ -1408,6 +1429,7 @@
62ECBFAF1C0B6D3B00AF847B /* HTMLNodeIterator.h in Headers */,
62ECBFB01C0B6D3C00AF847B /* HTMLTreeWalker.h in Headers */,
62ECBFB21C0B6D3C00AF847B /* HTMLNodeFilter.h in Headers */,
625A67CA224AC62C00C6D57D /* NSString+Private.h in Headers */,
62567F511C0CB5750025D458 /* HTMLDOMTokenList.h in Headers */,
62ECBFB31C0B6D3C00AF847B /* HTMLKitDOMExceptions.h in Headers */,
62ECBFB41C0B6D3D00AF847B /* HTMLNamespaces.h in Headers */,
Expand Down Expand Up @@ -1730,6 +1752,7 @@
62ECBF2A1C0B6B7900AF847B /* HTMLNode.m in Sources */,
62ECBF2B1C0B6B7900AF847B /* HTMLDocument.m in Sources */,
62ECBF2C1C0B6B7900AF847B /* HTMLDocumentType.m in Sources */,
625A67D2224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */,
62ECBF2D1C0B6B7900AF847B /* HTMLDocumentFragment.m in Sources */,
62ECBF2E1C0B6B7900AF847B /* HTMLElement.m in Sources */,
62ECBF2F1C0B6B7900AF847B /* HTMLComment.m in Sources */,
Expand All @@ -1748,6 +1771,7 @@
62ECBF3C1C0B6B7900AF847B /* CSSInputStream.m in Sources */,
62ECBF3D1C0B6B7900AF847B /* CSSSelectorParser.m in Sources */,
62ECBF3E1C0B6B7900AF847B /* CSSNthExpressionParser.m in Sources */,
625A67CD224AC62C00C6D57D /* NSString+Private.m in Sources */,
62ECBF3F1C0B6B7900AF847B /* CSSSelector.m in Sources */,
62ECBF401C0B6B7900AF847B /* CSSSelectorBlock.m in Sources */,
62ECBF411C0B6B7900AF847B /* CSSTypeSelector.m in Sources */,
Expand Down Expand Up @@ -1820,6 +1844,7 @@
62857C811D398912008DC254 /* HTMLParseErrorToken.m in Sources */,
62857CD21D3989B8008DC254 /* CSSCombinatorSelector.m in Sources */,
62857CB91D398992008DC254 /* HTMLNodeIterator.m in Sources */,
625A67D5224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */,
62857CCF1D3989B8008DC254 /* CSSPseudoClassSelector.m in Sources */,
62857C7A1D398912008DC254 /* HTMLInputStreamReader.m in Sources */,
62857CC11D39899C008DC254 /* NSCharacterSet+HTMLKit.m in Sources */,
Expand All @@ -1838,6 +1863,7 @@
62857CBC1D398992008DC254 /* HTMLNodeFilter.m in Sources */,
62857CC01D39899C008DC254 /* NSString+HTMLKit.m in Sources */,
62857CCA1D3989B8008DC254 /* CSSInputStream.m in Sources */,
625A67D0224AC62C00C6D57D /* NSString+Private.m in Sources */,
62857CCE1D3989B8008DC254 /* CSSAttributeSelector.m in Sources */,
62857CC31D3989A3008DC254 /* HTMLOrderedDictionary.m in Sources */,
62857CC91D3989B8008DC254 /* CSSNthExpressionParser.m in Sources */,
Expand Down Expand Up @@ -1875,6 +1901,7 @@
62857D0F1D39A32A008DC254 /* HTMLNode.m in Sources */,
62857D2C1D39A334008DC254 /* CSSCombinatorSelector.m in Sources */,
62857D181D39A32A008DC254 /* HTMLNodeIterator.m in Sources */,
625A67D4224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */,
62857D291D39A334008DC254 /* CSSPseudoClassSelector.m in Sources */,
62857D011D39A324008DC254 /* HTMLInputStreamReader.m in Sources */,
62857D1E1D39A334008DC254 /* NSCharacterSet+HTMLKit.m in Sources */,
Expand All @@ -1893,6 +1920,7 @@
62857D1B1D39A32A008DC254 /* HTMLNodeFilter.m in Sources */,
62857D1D1D39A334008DC254 /* NSString+HTMLKit.m in Sources */,
62857D241D39A334008DC254 /* CSSInputStream.m in Sources */,
625A67CF224AC62C00C6D57D /* NSString+Private.m in Sources */,
62857D281D39A334008DC254 /* CSSAttributeSelector.m in Sources */,
62857D1F1D39A334008DC254 /* HTMLOrderedDictionary.m in Sources */,
62857D231D39A334008DC254 /* CSSNthExpressionParser.m in Sources */,
Expand Down Expand Up @@ -1965,6 +1993,7 @@
62ECBF721C0B6D2A00AF847B /* HTMLNode.m in Sources */,
62ECBF731C0B6D2A00AF847B /* HTMLDocument.m in Sources */,
62ECBF741C0B6D2A00AF847B /* HTMLDocumentType.m in Sources */,
625A67D3224ADC7700C6D57D /* HTMLQuircksMode.m in Sources */,
62ECBF751C0B6D2A00AF847B /* HTMLDocumentFragment.m in Sources */,
62ECBF761C0B6D2A00AF847B /* HTMLElement.m in Sources */,
62ECBF771C0B6D2A00AF847B /* HTMLComment.m in Sources */,
Expand All @@ -1983,6 +2012,7 @@
62ECBF841C0B6D2A00AF847B /* CSSInputStream.m in Sources */,
62ECBF851C0B6D2A00AF847B /* CSSSelectorParser.m in Sources */,
62ECBF861C0B6D2A00AF847B /* CSSNthExpressionParser.m in Sources */,
625A67CE224AC62C00C6D57D /* NSString+Private.m in Sources */,
62ECBF871C0B6D2A00AF847B /* CSSSelector.m in Sources */,
62ECBF881C0B6D2A00AF847B /* CSSSelectorBlock.m in Sources */,
62ECBF891C0B6D2A00AF847B /* CSSTypeSelector.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Sources/CSSAttributeSelector.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ - (BOOL)acceptElement:(HTMLElement *)element
}
case CSSAttributeSelectorIncludes:
{
NSArray *components = [element[_name] componentsSeparatedByCharactersInSet:[NSCharacterSet HTMLWhitespaceCharacterSet]];
NSArray *components = [element[_name] componentsSeparatedByCharactersInSet:[NSCharacterSet htmlkit_HTMLWhitespaceCharacterSet]];
return [components containsObject:_value];
}
case CSSAttributeSelectorBegins:
Expand Down
4 changes: 2 additions & 2 deletions Sources/CSSNthExpressionParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "CSSNthExpressionParser.h"
#import "CSSCodePoints.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"
#import "NSCharacterSet+HTMLKit.h"

@implementation CSSNthExpressionParser
Expand All @@ -26,7 +26,7 @@ + (CSSNthExpression)parseExpression:(NSString *)expression
return CSSNthExpressionEven;
}

NSCharacterSet *set = [[NSCharacterSet CSSNthExpressionCharacterSet] invertedSet];
NSCharacterSet *set = [[NSCharacterSet htmlkit_CSSNthExpressionCharacterSet] invertedSet];
if ([string rangeOfCharacterFromSet:set].location != NSNotFound) {
return CSSNthExpressionMake(0, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/CSSSelectorParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "CSSInputStream.h"
#import "CSSCodePoints.h"
#import "CSSSelectors.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"
#import "NSCharacterSet+HTMLKit.h"
#import "CSSNthExpressionParser.h"
#import "CSSCompoundSelector.h"
Expand Down
2 changes: 1 addition & 1 deletion Sources/CSSStructuralPseudoSelectors.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "CSSStructuralPseudoSelectors.h"
#import "CSSSelectors.h"
#import "HTMLElement.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"

#pragma mark - Elements

Expand Down
2 changes: 1 addition & 1 deletion Sources/CSSTypeSelector.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "CSSTypeSelector.h"
#import "HTMLElement.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"

@interface CSSTypeSelector ()
{
Expand Down
8 changes: 4 additions & 4 deletions Sources/HTMLCharacterToken.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (void)appendString:(NSString *)string

- (BOOL)isWhitespaceToken
{
return [_characters isHTMLWhitespaceString];
return [_characters htmlkit_isHTMLWhitespaceString];
}

- (BOOL)isEmpty
Expand All @@ -46,15 +46,15 @@ - (BOOL)isEmpty

- (void)retainLeadingWhitespace
{
NSUInteger index = _characters.leadingHTMLWhitespaceLength;
NSUInteger index = _characters.htmlkit_leadingHTMLWhitespaceLength;
if (index > 0) {
[_characters setString:[_characters substringToIndex:index]];
}
}

- (void)trimLeadingWhitespace
{
NSUInteger index = _characters.leadingHTMLWhitespaceLength;
NSUInteger index = _characters.htmlkit_leadingHTMLWhitespaceLength;
if (index > 0) {
[_characters setString:[_characters substringFromIndex:index]];
}
Expand All @@ -67,7 +67,7 @@ - (void)trimFormIndex:(NSUInteger)index

- (HTMLCharacterToken *)tokenBySplitingLeadingWhiteSpace
{
NSUInteger index = _characters.leadingHTMLWhitespaceLength;
NSUInteger index = _characters.htmlkit_leadingHTMLWhitespaceLength;
if (index > 0) {
NSString *leading = [_characters substringToIndex:index];
[_characters setString:[_characters substringFromIndex:index]];
Expand Down
2 changes: 1 addition & 1 deletion Sources/HTMLDocumentType.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "HTMLDocumentType.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"
#import "HTMLNode+Private.h"

NS_INLINE BOOL nilOrEqual(id first, id second) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/HTMLElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "HTMLText.h"
#import "HTMLDOMTokenList.h"
#import "HTMLOrderedDictionary.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"
#import "HTMLNode+Private.h"

@interface HTMLElement ()
Expand Down
2 changes: 1 addition & 1 deletion Sources/HTMLInputStreamReader.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ - (BOOL)consumeDecimalNumber:(NSDecimal *)result

- (BOOL)consumeHexNumber:(unsigned long long *)result
{
NSCharacterSet *set = [NSCharacterSet HTMLHexNumberCharacterSet];
NSCharacterSet *set = [NSCharacterSet htmlkit_HTMLHexNumberCharacterSet];

NSString *string = nil;
BOOL success = [_scanner scanCharactersFromSet:set intoString:&string];
Expand Down
2 changes: 1 addition & 1 deletion Sources/HTMLKit-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.5</string>
<string>3.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
8 changes: 4 additions & 4 deletions Sources/HTMLParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ - (void)HTMLInsertionModeInBody:(HTMLToken *)token
if (charactes.length > 0) {
[self reconstructActiveFormattingElements];
[self insertCharacters:charactes];
if (!charactes.isHTMLWhitespaceString) {
if (!charactes.htmlkit_isHTMLWhitespaceString) {
_framesetOkFlag = NO;
}
}
Expand Down Expand Up @@ -2313,7 +2313,7 @@ - (void)HTMLInsertionModeInFrameset:(HTMLToken *)token
[characters enumerateSubstringsInRange:NSMakeRange(0, characters.length)
options:NSStringEnumerationByComposedCharacterSequences
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
if (substring.isHTMLWhitespaceString) {
if (substring.htmlkit_isHTMLWhitespaceString) {
[self insertCharacters:substring];
} else {
[self emitParseError:@"Unexpected Character (%@) in <frameset>", substring];
Expand Down Expand Up @@ -2381,7 +2381,7 @@ - (void)HTMLInsertionModeAfterFrameset:(HTMLToken *)token
[characters enumerateSubstringsInRange:NSMakeRange(0, characters.length)
options:NSStringEnumerationByComposedCharacterSequences
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
if (substring.isHTMLWhitespaceString) {
if (substring.htmlkit_isHTMLWhitespaceString) {
[self insertCharacters:substring];
} else {
[self emitParseError:@"Unexpected Character (%@) after <frameset>", substring];
Expand Down Expand Up @@ -2515,7 +2515,7 @@ - (void)processTokenByApplyingRulesForParsingTokensInForeignContent:(HTMLToken *
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
if ([substring isEqualToString:@"\uFFFD"]) {
[self emitParseError:@"Unexpected Character (0x0000) in foreign content"];
} else if (!substring.isHTMLWhitespaceString) {
} else if (!substring.htmlkit_isHTMLWhitespaceString) {
_framesetOkFlag = NO;
}
[self insertCharacters:substring];
Expand Down
21 changes: 21 additions & 0 deletions Sources/HTMLQuircksMode.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// HTMLQuircksMode.m
// HTMLKit
//
// Created by Iska on 26.03.19.
// Copyright © 2019 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HTMLQuirksMode.h"
#import "NSString+Private.h"

BOOL QuirksModePrefixMatch(NSString *publicIdentifier)
{
for (int i = 0; i < sizeof(HTMLQuirksModePrefixes) / sizeof(HTMLQuirksModePrefixes[0]); i++) {
if ([publicIdentifier hasPrefixIgnoringCase:HTMLQuirksModePrefixes[i]]) {
return YES;
}
}
return NO;
}
2 changes: 1 addition & 1 deletion Sources/HTMLText.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "HTMLText.h"
#import "HTMLElement.h"
#import "NSString+HTMLKit.h"
#import "NSString+Private.h"
#import "HTMLCharacterData+Private.h"
#import "HTMLKitDOMExceptions.h"
#import "HTMLDocument+Private.h"
Expand Down
6 changes: 3 additions & 3 deletions Sources/NSCharacterSet+HTMLKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@implementation NSCharacterSet (HTMLKit)

+ (instancetype)HTMLWhitespaceCharacterSet
+ (instancetype)htmlkit_HTMLWhitespaceCharacterSet
{
static NSCharacterSet *set = nil;
static dispatch_once_t onceToken;
Expand All @@ -20,7 +20,7 @@ + (instancetype)HTMLWhitespaceCharacterSet
return set;
}

+ (instancetype)HTMLHexNumberCharacterSet
+ (instancetype)htmlkit_HTMLHexNumberCharacterSet
{
static NSCharacterSet *set = nil;
static dispatch_once_t onceToken;
Expand All @@ -30,7 +30,7 @@ + (instancetype)HTMLHexNumberCharacterSet
return set;
}

+ (instancetype)CSSNthExpressionCharacterSet
+ (instancetype)htmlkit_CSSNthExpressionCharacterSet
{
static NSCharacterSet *set = nil;
static dispatch_once_t onceToken;
Expand Down
Loading

0 comments on commit 70eeecb

Please sign in to comment.