Add HTML Tokenizer property to set the associated parser object
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
#import "HTMLMarker.h"
|
||||
#import "NSString+HTMLKit.h"
|
||||
|
||||
@interface HTMLTokenizer (Private)
|
||||
@property (nonatomic, weak) HTMLParser *parser;
|
||||
@end
|
||||
|
||||
@interface HTMLDocument (Private)
|
||||
@property (nonatomic, assign) HTMLDocumentReadyState readyState;
|
||||
@@ -70,6 +73,7 @@
|
||||
_stackOfOpenElements = [HTMLStackOfOpenElements new];
|
||||
_listOfActiveFormattingElements = [NSMutableArray new];
|
||||
_tokenizer = [[HTMLTokenizer alloc] initWithString:string];
|
||||
_tokenizer.parser = self;
|
||||
|
||||
_pendingTableCharacterTokens = [[HTMLCharacterToken alloc] initWithString:@""];
|
||||
|
||||
|
||||
@@ -14,9 +14,13 @@
|
||||
* HTML Tokenizer
|
||||
* https://html.spec.whatwg.org/multipage/syntax.html#tokenization
|
||||
*/
|
||||
|
||||
@class HTMLParser;
|
||||
|
||||
@interface HTMLTokenizer : NSObject <NSFastEnumeration>
|
||||
|
||||
@property (nonatomic, assign) HTMLTokenizerState state;
|
||||
@property (nonatomic, weak, readonly) HTMLParser *parser;
|
||||
|
||||
- (instancetype)initWithString:(NSString *)string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user