Skip to content

Commit

Permalink
Merge pull request #1333 from wordpress-mobile/feature/mark-tag-support
Browse files Browse the repository at this point in the history
Feature - Adds support for the Mark HTML tag
  • Loading branch information
Gerardo Pacheco authored Oct 8, 2021
2 parents e0cb3c9 + d0af87a commit 6f58df6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ orbs:
git: wordpress-mobile/[email protected]

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:
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.4
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion Aztec/Classes/Libxml2/DOM/Data/Element.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct Element: RawRepresentable, Hashable {
public static var mergeableBlockLevelElements = Set<Element>([.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<Element>([.i, .em, .b, .strong, .strike, .u, .code, .cite, .a, .sup, .sub])
public static var mergeableStyleElements = Set<Element>([.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
///
Expand Down Expand Up @@ -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")

}

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.19.5
-------
* Addd support for the Mark HTML tag.

1.19.4
-------
* Fix Carthage build for Xcode 12
Expand Down
6 changes: 6 additions & 0 deletions Example/Example/SampleContent/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,9 @@ <h3>Unsupported HTML</h3>
</table>

<hr/>

<h3>Mark</h3>

<p>Donec ipsum dolor, <mark style="color:#ff0000">tempor sed</mark> bibendum <mark style="color:#1100ff">vita</mark>.</p>

<hr/>
8 changes: 8 additions & 0 deletions Example/Example/SampleContent/gutenberg.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,11 @@ <h2 style="text-align:center">The WordPress of tomorrow</h2>
<!-- /wp:separator -->

<!-- wp:latest-posts /-->

<!-- wp:separator -->
<hr class="wp-block-separator" />
<!-- /wp:separator -->

<!-- wp:paragraph -->
<p>Donec ipsum dolor, <mark style="color:#ff0000">tempor sed</mark> bibendum <mark style="color:#1100ff">vita</mark>.</p>
<!-- /wp:paragraph -->

0 comments on commit 6f58df6

Please sign in to comment.