Skip to content

Commit be24064

Browse files
Merge pull request #1286 from wordpress-mobile/release/1.19.1
Release/1.19.1
2 parents 26443eb + bb5316b commit be24064

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

Aztec/Classes/Libxml2/Converters/In/HTMLParser.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@ open class HTMLParser {
4545
//
4646
htmlHandleOmittedElem(0)
4747

48+
var parserOptions = HTML_PARSE_RECOVER.rawValue | HTML_PARSE_NODEFDTD.rawValue | HTML_PARSE_NOERROR.rawValue | HTML_PARSE_NOWARNING.rawValue | HTML_PARSE_NOIMPLIED.rawValue
49+
if shouldCollapseSpaces {
50+
parserOptions = parserOptions | HTML_PARSE_NOBLANKS.rawValue
51+
}
4852
let document = htmlCtxtReadMemory(parserContext,
4953
htmlPtr,
5054
Int32(wrappedHTML.lengthOfBytes(using: String.Encoding.utf8)),
5155
"",
5256
"UTF-8",
53-
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))
57+
Int32(parserOptions))
5458

5559
defer {
5660
xmlFreeDoc(document)

AztecTests/TextKit/TextStorageTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class TextStorageTests: XCTestCase {
566566
/// Verifies that spaces are not collapsed
567567
///
568568
func testConverterCollapsesSpacesText() {
569-
let initialHTML = "<p> Hello World </p>"
569+
let initialHTML = "<p> Hello <br> <strong>World</strong> </p>"
570570

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

578-
let expectedResult = "<p> Hello World </p>"
578+
let expectedResult = "<p> Hello <br> <strong>World</strong> </p>"
579579
let result = storage.getHTML()
580580
XCTAssertEqual(expectedResult, result)
581581
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.19.1
2+
-------
3+
* Fix a bug where collapse of whitespaces was happening for empty HTML nodes.
4+
15
1.19.0
26
-------
37
* Add support for the sup and sub HTML tags.

WordPress-Aztec-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'WordPress-Aztec-iOS'
11-
s.version = '1.19.0'
11+
s.version = '1.19.1'
1212
s.summary = 'The native HTML Editor.'
1313

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

WordPress-Editor-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'WordPress-Editor-iOS'
11-
s.version = '1.19.0'
11+
s.version = '1.19.1'
1212
s.summary = 'The WordPress HTML Editor.'
1313

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

0 commit comments

Comments
 (0)