Skip to content

Commit

Permalink
Merge pull request #1286 from wordpress-mobile/release/1.19.1
Browse files Browse the repository at this point in the history
Release/1.19.1
  • Loading branch information
SergioEstevao authored May 12, 2020
2 parents 26443eb + bb5316b commit be24064
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Aztec/Classes/Libxml2/Converters/In/HTMLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ open class HTMLParser {
//
htmlHandleOmittedElem(0)

var parserOptions = HTML_PARSE_RECOVER.rawValue | HTML_PARSE_NODEFDTD.rawValue | HTML_PARSE_NOERROR.rawValue | HTML_PARSE_NOWARNING.rawValue | HTML_PARSE_NOIMPLIED.rawValue
if shouldCollapseSpaces {
parserOptions = parserOptions | HTML_PARSE_NOBLANKS.rawValue
}
let document = htmlCtxtReadMemory(parserContext,
htmlPtr,
Int32(wrappedHTML.lengthOfBytes(using: String.Encoding.utf8)),
"",
"UTF-8",
Int32(HTML_PARSE_RECOVER.rawValue | HTML_PARSE_NODEFDTD.rawValue | HTML_PARSE_NOERROR.rawValue | HTML_PARSE_NOWARNING.rawValue | HTML_PARSE_NOIMPLIED.rawValue | HTML_PARSE_NOBLANKS.rawValue))
Int32(parserOptions))

defer {
xmlFreeDoc(document)
Expand Down
4 changes: 2 additions & 2 deletions AztecTests/TextKit/TextStorageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ class TextStorageTests: XCTestCase {
/// Verifies that spaces are not collapsed
///
func testConverterCollapsesSpacesText() {
let initialHTML = "<p> Hello World </p>"
let initialHTML = "<p> Hello <br> <strong>World</strong> </p>"

// Setup
let defaultAttributes: [NSAttributedString.Key: Any] = [.font: UIFont.systemFont(ofSize: 14),
Expand All @@ -575,7 +575,7 @@ class TextStorageTests: XCTestCase {
storage.htmlConverter.shouldCollapseSpaces = false
storage.setHTML(initialHTML, defaultAttributes: defaultAttributes)

let expectedResult = "<p> Hello World </p>"
let expectedResult = "<p> Hello <br> <strong>World</strong> </p>"
let result = storage.getHTML()
XCTAssertEqual(expectedResult, result)
}
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.1
-------
* Fix a bug where collapse of whitespaces was happening for empty HTML nodes.

1.19.0
-------
* Add support for the sup and sub HTML tags.
Expand Down
2 changes: 1 addition & 1 deletion WordPress-Aztec-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'WordPress-Aztec-iOS'
s.version = '1.19.0'
s.version = '1.19.1'
s.summary = 'The native HTML Editor.'

# This description is used to generate tags and improve search results.
Expand Down
2 changes: 1 addition & 1 deletion WordPress-Editor-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'WordPress-Editor-iOS'
s.version = '1.19.0'
s.version = '1.19.1'
s.summary = 'The WordPress HTML Editor.'

# This description is used to generate tags and improve search results.
Expand Down

0 comments on commit be24064

Please sign in to comment.