diff --git a/Aztec/Classes/TextKit/LayoutManager.swift b/Aztec/Classes/TextKit/LayoutManager.swift index 4e277b255..772aa7d23 100644 --- a/Aztec/Classes/TextKit/LayoutManager.swift +++ b/Aztec/Classes/TextKit/LayoutManager.swift @@ -369,8 +369,7 @@ extension LayoutManager { let underlinedString = textStorage.attributedSubstring(from: glyphRange).string var updatedGlyphRange = glyphRange if glyphRange.endLocation == lineGlyphRange.endLocation, - underlinedString.contains(String.init(.nonBreakingSpace)), - underlinedString.hasSuffix(String.init(.paragraphSeparator)) + underlinedString.hasSuffix(String.init(.paragraphSeparator)) || underlinedString.hasSuffix(String.init(.lineSeparator)) || underlinedString.hasSuffix(String.init(.carriageReturn)) || underlinedString.hasSuffix(String.init(.lineFeed)) { updatedGlyphRange = NSRange(location: glyphRange.location, length: glyphRange.length - 1) } diff --git a/CHANGELOG.md b/CHANGELOG.md index 635240b3a..cea160fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +1.19.2 +------- +* Fix drawing of underlines when they include newlines. + 1.19.1 ------- * Fix a bug where collapse of whitespaces was happening for empty HTML nodes. diff --git a/Example/Example/SampleContent/underline.html b/Example/Example/SampleContent/underline.html index 86fc4e322..fc73045a6 100644 --- a/Example/Example/SampleContent/underline.html +++ b/Example/Example/SampleContent/underline.html @@ -1,4 +1,5 @@ -

Hello world

+

No NBSP

+

With NBSP

Alternative underline text

Before link Link to WordPress

Before link Link to Jetpack After link

diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index ffafac692..083f661c3 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'WordPress-Aztec-iOS' - s.version = '1.19.1' + s.version = '1.19.2' s.summary = 'The native HTML Editor.' # This description is used to generate tags and improve search results. diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index cdbf801bc..8971b3f46 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'WordPress-Editor-iOS' - s.version = '1.19.1' + s.version = '1.19.2' s.summary = 'The WordPress HTML Editor.' # This description is used to generate tags and improve search results.