From 76753b1d9569a9f23dfcfd8fbab9ca615f2a9298 Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 17:33:22 +0100 Subject: [PATCH 1/7] Update html5lib-tests to latest commit as of 2017.02.11 Commit: 13f1805136f8a6b3883d1cf7c727ad0a6b97eab1 --- Tests/html5lib-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/html5lib-tests b/Tests/html5lib-tests index 50568b5..13f1805 160000 --- a/Tests/html5lib-tests +++ b/Tests/html5lib-tests @@ -1 +1 @@ -Subproject commit 50568b5664d6b034b752310603b2b664d045ad0f +Subproject commit 13f1805136f8a6b3883d1cf7c727ad0a6b97eab1 From 05c6b9d294521fec1934f2bd64b16b5e4c55284d Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 18:27:25 +0100 Subject: [PATCH 2/7] Expect to parse like an unknown element This reverses the parser change introduced in commit: b0bad5068f239eed593c97cd64f44215194ed497 The list of special elements is not reverted The change was reverted in the spec: https://github.com/whatwg/html/pull/2319 and the html5lib-tests: https://github.com/html5lib/html5lib-tests/pull/88 --- Sources/HTMLParser.m | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/Sources/HTMLParser.m b/Sources/HTMLParser.m index aff3f97..74844bc 100644 --- a/Sources/HTMLParser.m +++ b/Sources/HTMLParser.m @@ -514,7 +514,7 @@ - (void)generateImpliedEndTagsExceptForElement:(NSString *)tagName { - while ([self.currentNode.tagName isEqualToAny:@"dd", @"dt", @"li", @"menuitem", @"option", @"optgroup", @"p", @"rb", @"rp", @"rt", @"rtc", nil] && + while ([self.currentNode.tagName isEqualToAny:@"dd", @"dt", @"li", @"option", @"optgroup", @"p", @"rb", @"rp", @"rt", @"rtc", nil] && ![self.currentNode.tagName isEqualToString:tagName]) { [_stackOfOpenElements popCurrentNode]; } @@ -1162,8 +1162,8 @@ [self HTMLInsertionModeInTemplate:token]; } else { for (HTMLElement *node in _stackOfOpenElements) { - if ([node.tagName isEqualToAny:@"dd", @"dt", @"li", @"menuitem", @"optgroup", @"option", @"p", @"rb", - @"rp", @"rt", @"rtc", @"tbody", @"td", @"tfoot", @"th", @"thead", @"tr", @"body", @"html", nil]) { + if ([node.tagName isEqualToAny:@"dd", @"dt", @"li", @"optgroup", @"option", @"p", @"rb", @"rp", + @"rt", @"rtc", @"tbody", @"td", @"tfoot", @"th", @"thead", @"tr", @"body", @"html", nil]) { [self emitParseError:@"EOF reached with unclosed element <%@> in ", node.tagName]; break; } @@ -1226,20 +1226,12 @@ [self switchInsertionMode:HTMLInsertionModeInFrameset]; } else if ([tagName isEqualToAny:@"address", @"article", @"aside", @"blockquote", @"center", @"details", @"dialog", @"dir", @"div", @"dl", @"fieldset", @"figcaption", @"figure", - @"footer", @"header", @"hgroup", @"main", @"nav", @"ol", @"p", @"section", + @"footer", @"header", @"hgroup", @"main", @"menu", @"nav", @"ol", @"p", @"section", @"summary", @"ul", nil]) { if ([_stackOfOpenElements hasElementInButtonScopeWithTagName:@"p"]) { [self closePElement]; } [self insertElementForToken:token]; - } else if ([tagName isEqualToString:@"menu"]) { - if ([_stackOfOpenElements hasElementInButtonScopeWithTagName:@"p"]) { - [self closePElement]; - } - if ([self.currentNode.tagName isEqualToString:@"menuitem"]) { - [_stackOfOpenElements popCurrentNode]; - } - [self insertElementForToken:token]; } else if ([tagName isEqualToAny:@"h1", @"h2", @"h3", @"h4", @"h5", @"h6", nil]) { if ([_stackOfOpenElements hasElementInButtonScopeWithTagName:@"p"]) { [self closePElement]; @@ -1383,9 +1375,6 @@ if ([_stackOfOpenElements hasElementInButtonScopeWithTagName:@"p"]) { [self closePElement]; } - if ([self.currentNode.tagName isEqualToString:@"menuitem"]) { - [_stackOfOpenElements popCurrentNode]; - } [self insertElementForToken:token]; [_stackOfOpenElements popCurrentNode]; _framesetOkFlag = NO; @@ -1431,12 +1420,6 @@ } [self reconstructActiveFormattingElements]; [self insertElementForToken:token]; - } else if ([tagName isEqualToString:@"menuitem"]) { - if ([self.currentNode.tagName isEqualToString:@"menuitem"]) { - [_stackOfOpenElements popCurrentNode]; - } - [self reconstructActiveFormattingElements]; - [self insertElementForToken:token]; } else if ([tagName isEqualToAny:@"rb", @"rtc", nil]) { if ([_stackOfOpenElements hasElementInScopeWithTagName:@"ruby"]) { [self generateImpliedEndTagsExceptForElement:nil]; @@ -1491,8 +1474,8 @@ [self emitParseError:@"Unexpected end tag without body element in scope in "]; } for (HTMLElement *node in _stackOfOpenElements) { - if ([node.tagName isEqualToAny:@"dd", @"dt", @"li", @"menuitem", @"optgroup", @"option", @"p", @"rb", @"rp", - @"rt", @"rtc", @"tbody", @"td", @"tfoot", @"th", @"thead", @"tr", @"body", @"html", nil]) { + if ([node.tagName isEqualToAny:@"dd", @"dt", @"li", @"optgroup", @"option", @"p", @"rb", @"rp", @"rt", + @"rtc", @"tbody", @"td", @"tfoot", @"th", @"thead", @"tr", @"body", @"html", nil]) { [self emitParseError:@"Misnested end tag with open element <%@> in ", tagName, node.tagName]; break; } From 325ca475877f632b23f165857a9377bf7c8669ad Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 19:21:44 +0100 Subject: [PATCH 3/7] Add Changelog entry for HTMLKit 2.0.0 --- CHANGELOG.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37ffbba..57b37aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## [2.0.0](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.0) + +Released on 2017.02.11 + +### Spec Change + +- Make `` parse like an unkonwn element. See: + - [whatwg/html#2319](https://github.com/whatwg/html/pull/2319) + - [html5lib/html5lib-tests#88](https://github.com/html5lib/html5lib-tests/pull/88) + +### Updated + +- Updated HTML5Lib-Tests submodule (13f1805) + + ## [1.1.0](https://github.com/iabudiab/HTMLKit/releases/tag/1.1.0) Released on 2017.01.14 @@ -79,9 +94,7 @@ This release passes all tokenizer and tree construction html5lib-tests as of 201 - `` is completely removed from the spec now, therefore it is dropped from the implementation - `Tokenizer` and `Tree-Construction` tests are now generated dynamically - Test failures are collected by a `XCTestObservation` for better reporting -- `` is completely removed from the spec now, therefore it is dropped from the implementation -- `Tokenizer` and `Tree-Construction` tests are now generated dynamically -- Test failures are collected by a `XCTestObservation` for better reporting + ### Fixed From 0b8b18b6757f31bbf5dbbd388dcc7461c6fb51fd Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 19:21:55 +0100 Subject: [PATCH 4/7] Update podspec for 2.0.0 --- HTMLKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HTMLKit.podspec b/HTMLKit.podspec index 13c58c1..1217b8f 100644 --- a/HTMLKit.podspec +++ b/HTMLKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "HTMLKit" - s.version = "1.1.0" + s.version = "2.0.0" s.summary = "HTMLKit, an Objective-C framework for your everyday HTML needs." s.license = "MIT" s.homepage = "https://github.com/iabudiab/HTMLKit" From 6d7e9bca1b264cf5938c6bebd14fe8f0f6971f29 Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 19:22:05 +0100 Subject: [PATCH 5/7] Update jazzy.yaml for 2.0.0 --- .jazzy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index 115f74d..f5c4aea 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,5 +1,5 @@ module: HTMLKit -module_version: 1.1.0 +module_version: 2.0.0 author: Iskandar Abudiab author_url: https://twitter.com/iabudiab github_url: https://github.com/iabudiab/HTMLKit From 987d37e042c6196dc2410b7eead878f5f05a3561 Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 19:22:14 +0100 Subject: [PATCH 6/7] Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fdf1e55..6b47351 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ An Objective-C framework for your everyday HTML needs. -[![Build Status](https://img.shields.io/travis/iabudiab/HTMLKit/develop.svg?style=flat)](https://travis-ci.org/iabudiab/HTMLKit) +[![Build Status](https://img.shields.io/travis/iabudiab/HTMLKit/master.svg?style=flat)](https://travis-ci.org/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) @@ -78,7 +78,7 @@ To add `HTMLKit` as a dependency into your project using CocoaPods just add the use_frameworks! target 'MyTarget' do - pod 'HTMLKit', '~> 1.1' + pod 'HTMLKit', '~> 2.0' end ``` @@ -95,7 +95,7 @@ $ pod install Add `HTMLKit` to your `Package.swift` dependecies: ```swift -.Package(url: "https://github.com/iabudiab/HTMLKit", majorVersion: 1) +.Package(url: "https://github.com/iabudiab/HTMLKit", majorVersion: 2) ``` Then run: From d6d1e774716f2ca0cc6a638dcf937bdfa8984d2d Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 11 Feb 2017 19:22:24 +0100 Subject: [PATCH 7/7] Bump HTMLKit version to 2.0.0 --- Sources/HTMLKit-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/HTMLKit-Info.plist b/Sources/HTMLKit-Info.plist index 7fde877..c058e07 100644 --- a/Sources/HTMLKit-Info.plist +++ b/Sources/HTMLKit-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.1.0 + 2.0.0 CFBundleSignature ???? CFBundleVersion