diff --git a/.circleci/config.yml b/.circleci/config.yml index c6569b798..900eb1b0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,11 +6,11 @@ orbs: git: wordpress-mobile/git@1.0 xcode_version: &xcode_version - xcode-version: "12.1.0" + xcode-version: "12.4.0" iphone_test_device: &iphone_test_device device: iPhone 11 - ios-version: "14.1" + ios-version: "14.4" workflows: test_and_validate: diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..2714f5313 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.6.4 diff --git a/Aztec/Classes/Converters/ElementsToAttributedString/Implementations/GenericElementConverter.swift b/Aztec/Classes/Converters/ElementsToAttributedString/Implementations/GenericElementConverter.swift index 80f64de3a..aca55ab0c 100644 --- a/Aztec/Classes/Converters/ElementsToAttributedString/Implementations/GenericElementConverter.swift +++ b/Aztec/Classes/Converters/ElementsToAttributedString/Implementations/GenericElementConverter.swift @@ -11,7 +11,7 @@ class GenericElementConverter: ElementConverter { /// At some point we should modify how the conversion works, so that any supported element never goes through this /// converter at all, and this converter is turned into an `UnsupportedElementConverter()` exclusively. /// - private static let supportedElements: [Element] = [.a, .aztecRootNode, .b, .br, .blockquote, .del, .div, .em, .figure, .figcaption, .h1, .h2, .h3, .h4, .h5, .h6, .hr, .i, .img, .li, .ol, .p, .pre, .s, .span, .strike, .strong, .u, .ul, .video, .code, .sup, .sub] + private static let supportedElements: [Element] = [.a, .aztecRootNode, .b, .br, .blockquote, .del, .div, .em, .figure, .figcaption, .h1, .h2, .h3, .h4, .h5, .h6, .hr, .i, .img, .li, .ol, .p, .pre, .s, .span, .strike, .strong, .u, .ul, .video, .code, .sup, .sub, .mark] // MARK: - Built-in formatter instances diff --git a/Aztec/Classes/EditorView/EditorView.swift b/Aztec/Classes/EditorView/EditorView.swift index 53d727161..2df843372 100644 --- a/Aztec/Classes/EditorView/EditorView.swift +++ b/Aztec/Classes/EditorView/EditorView.swift @@ -269,11 +269,11 @@ extension EditorView: UITextInput { return activeView.characterRange(byExtending: position, in: direction) } - public func baseWritingDirection(for position: UITextPosition, in direction: UITextStorageDirection) -> UITextWritingDirection { + public func baseWritingDirection(for position: UITextPosition, in direction: UITextStorageDirection) -> NSWritingDirection { return activeView.baseWritingDirection(for: position, in: direction) } - public func setBaseWritingDirection(_ writingDirection: UITextWritingDirection, for range: UITextRange) { + public func setBaseWritingDirection(_ writingDirection: NSWritingDirection, for range: UITextRange) { activeView.setBaseWritingDirection(writingDirection, for: range) } diff --git a/Aztec/Classes/Libxml2/DOM/Data/Element.swift b/Aztec/Classes/Libxml2/DOM/Data/Element.swift index 308f73d35..610ba6e9d 100644 --- a/Aztec/Classes/Libxml2/DOM/Data/Element.swift +++ b/Aztec/Classes/Libxml2/DOM/Data/Element.swift @@ -30,7 +30,7 @@ public struct Element: RawRepresentable, Hashable { public static var mergeableBlockLevelElements = Set([.blockquote, .div, .figure, .figcaption, .h1, .h2, .h3, .h4, .h5, .h6, .hr, .li, .ol, .ul, .p, .pre]) /// List of style HTML elements that can be merged together when they are sibling to each other - public static var mergeableStyleElements = Set([.i, .em, .b, .strong, .strike, .u, .code, .cite, .a, .sup, .sub]) + public static var mergeableStyleElements = Set([.i, .em, .b, .strong, .strike, .u, .code, .cite, .a, .sup, .sub, .mark]) /// List of block level elements that can be merged but only when they have a single children that is also mergeable /// @@ -121,6 +121,7 @@ extension Element { public static let video = Element("video") public static let wbr = Element("wbr") public static let body = Element("body") + public static let mark = Element("mark") } diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6389e0a..2797701a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +1.19.5 +------- +* Addd support for the Mark HTML tag. + 1.19.4 ------- * Fix Carthage build for Xcode 12 diff --git a/Documentation/ReleaseProcess.md b/Documentation/ReleaseProcess.md index 38219be81..cb4cf4d8c 100644 --- a/Documentation/ReleaseProcess.md +++ b/Documentation/ReleaseProcess.md @@ -34,7 +34,7 @@ Open a PR on github where you target the `trunk` branch with the `release/x.y.z` ### Step 2: Testing the Integration ### -Before going any further, tt's normally good practice to test the Aztec integration into [WordPress-iOS project](https://github.com/wordpress-mobile/WordPress-iOS), to make sure we won’t have to do the release process twice. +Before going any further, it's normally good practice to test the Aztec integration into [WordPress-iOS project](https://github.com/wordpress-mobile/WordPress-iOS), to make sure we won’t have to do the release process twice. Make sure WordPress-iOS’s podfile specifies the SAME (and latest) commit number for both of these: ``` @@ -59,13 +59,13 @@ Create a new release on Github targetting the trunk branch and name it `Release Set a tag with the value `x.y.z` . -On the description field and the content of the changelog for this version +On the description field add the content of the changelog for this version Press the `Publish release` button At this moment the CI automation should notice your tag and after some minutes you should get the new pod publish on CocoaPods. -If this for some reason fails chech the manual process bellow +If this for some reason fails check the manual process below. Also note that the CI checks for a merged release PR can sometimes fail if the checks run prior to CocoaPods populating the new version through the CDN. Waiting a little while (e.g. 30-60 minutes) and rerunning the CI checks can sometimes repair the checks. *Manual Process* diff --git a/Example/Example/SampleContent/content.html b/Example/Example/SampleContent/content.html index f2fe34588..3d5b715ba 100644 --- a/Example/Example/SampleContent/content.html +++ b/Example/Example/SampleContent/content.html @@ -159,3 +159,9 @@

Unsupported HTML


+ +

Mark

+ +

Donec ipsum dolor, tempor sed bibendum vita.

+ +
diff --git a/Example/Example/SampleContent/gutenberg.html b/Example/Example/SampleContent/gutenberg.html index 772dbed27..edf1e78f9 100644 --- a/Example/Example/SampleContent/gutenberg.html +++ b/Example/Example/SampleContent/gutenberg.html @@ -140,3 +140,11 @@

The WordPress of tomorrow

+ + +
+ + + +

Donec ipsum dolor, tempor sed bibendum vita.

+ \ No newline at end of file diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index 1dee3bd72..dc77a2f60 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -1,34 +1,22 @@ -# -# Be sure to run `bundle exec pod lib lint WordPress-Aztec-iOS.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - Pod::Spec.new do |s| - s.name = 'WordPress-Aztec-iOS' - s.version = '1.19.4' - s.summary = 'The native HTML Editor.' + s.name = 'WordPress-Aztec-iOS' + s.version = '1.19.5' + + s.summary = 'The native HTML Editor.' + s.description = <<-DESC + The native HTML Editor by Automattic Inc. -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! + This library provides a UITextView subclass with HTML visual editing capabilities. + DESC - s.description = <<-DESC - The native HTML Editor by Automattic Inc. - DESC + s.homepage = 'https://github.com/wordpress-mobile/AztecEditor-iOS' + s.license = { :type => 'MPLv2', :file => 'LICENSE.md' } + s.author = { 'The WordPress Mobile Team' => 'mobile@wordpress.org' } - s.homepage = 'https://github.com/wordpress-mobile/WordPress-Aztec-iOS' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' - s.license = { :type => 'MPLv2', :file => 'LICENSE.md' } - s.author = { 'Automattic' => 'mobile@automattic.com', 'Diego Rey Mendez' => 'diego.rey.mendez@automattic.com', 'Sergio Estevao' => 'sergioestevao@gmail.com', 'Jorge Leandro Perez' => 'jorge.perez@automattic.com' } - s.source = { :git => 'https://github.com/wordpress-mobile/WordPress-Aztec-iOS.git', :tag => s.version.to_s } s.ios.deployment_target = '11.0' s.swift_version = '5.0' + s.source = { :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :tag => s.version.to_s } s.module_name = "Aztec" s.source_files = 'Aztec/Classes/**/*' s.resource_bundles = { @@ -36,7 +24,8 @@ Pod::Spec.new do |s| "Aztec/Assets/**/*" ] } - - s.xcconfig = {'OTHER_LDFLAGS' => '-lxml2', - 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2'} + s.xcconfig = { + 'OTHER_LDFLAGS' => '-lxml2', + 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2' + } end diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index fcf4e235f..dea91e6db 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -1,39 +1,30 @@ -# -# Be sure to run `bundle exec pod lib lint WordPress-Editor-iOS.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - Pod::Spec.new do |s| - s.name = 'WordPress-Editor-iOS' - s.version = '1.19.4' - s.summary = 'The WordPress HTML Editor.' + s.name = 'WordPress-Editor-iOS' + s.version = '1.19.5' + + s.summary = 'The WordPress HTML Editor.' + s.description = <<-DESC + The WordPress HTML Editor by Automattic Inc. -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! + This library provides a UITextView subclass with HTML visual editing capabilities. + Use this library if you want to create an App that interacts with WordPress HTML content. + DESC - s.description = <<-DESC - The WordPress HTML Editor by Automattic Inc. - DESC + s.homepage = 'https://github.com/wordpress-mobile/AztecEditor-iOS' + s.license = { :type => 'MPLv2', :file => 'LICENSE.md' } + s.author = { 'The WordPress Mobile Team' => 'mobile@wordpress.org' } - s.homepage = 'https://github.com/wordpress-mobile/WordPress-Aztec-iOS' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' - s.license = { :type => 'MPLv2', :file => 'LICENSE.md' } - s.author = { 'Automattic' => 'mobile@automattic.com', 'Diego Rey Mendez' => 'diego.rey.mendez@automattic.com', 'Sergio Estevao' => 'sergioestevao@gmail.com', 'Jorge Leandro Perez' => 'jorge.perez@automattic.com' } - s.source = { :git => 'https://github.com/wordpress-mobile/WordPress-Aztec-iOS.git', :tag => s.version.to_s } s.ios.deployment_target = '11.0' s.swift_version = '5.0' + + s.source = { :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :tag => s.version.to_s } s.module_name = "WordPressEditor" s.source_files = 'WordPressEditor/WordPressEditor/Classes/**/*' s.resources = 'WordPressEditor/WordPressEditor/Assets/**/*' - - s.xcconfig = {'OTHER_LDFLAGS' => '-lxml2', - 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2'} + s.xcconfig = { + 'OTHER_LDFLAGS' => '-lxml2', + 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2' + } s.dependency "WordPress-Aztec-iOS", s.version.to_s end