Skip to content

Commit 2d5c034

Browse files
authored
Prepare release 1.17.0 (#1272)
Fix drawing of underlines when they have a nbsp and span to the end of a line.
1 parent 3005501 commit 2d5c034

File tree

8 files changed

+29
-4
lines changed

8 files changed

+29
-4
lines changed

Aztec/Classes/TextKit/LayoutManager.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ private extension LayoutManager {
201201
}
202202
}
203203

204-
205204
// MARK: - Lists Helpers
206205
//
207206
private extension LayoutManager {
@@ -360,3 +359,16 @@ private extension LayoutManager {
360359
}
361360
}
362361
}
362+
363+
extension LayoutManager {
364+
365+
override func underlineGlyphRange(_ glyphRange: NSRange, underlineType underlineVal: NSUnderlineStyle, lineFragmentRect lineRect: CGRect, lineFragmentGlyphRange lineGlyphRange: NSRange, containerOrigin: CGPoint) {
366+
367+
var updatedGlyphRange = glyphRange
368+
if glyphRange.endLocation == lineGlyphRange.endLocation {
369+
updatedGlyphRange = NSRange(location: glyphRange.location, length: glyphRange.length - 1)
370+
}
371+
drawUnderline(forGlyphRange: updatedGlyphRange, underlineType: underlineVal, baselineOffset: 0, lineFragmentRect: lineRect, lineFragmentGlyphRange: lineGlyphRange, containerOrigin: containerOrigin)
372+
}
373+
}
374+

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.17.0
2+
-----
3+
* Fix drawing of underlines when they have a nbsp and span to the end of a line
4+
15
1.16.0
26
-----
37
* Improve display of ordered lists with large bullet numbers

Example/AztecExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
F1D3610B20929F0200B4E7A5 /* WordPressEditor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1D3610420929E6D00B4E7A5 /* WordPressEditor.framework */; };
4040
FF149F4A20E3C49A0070FECB /* imagesOverlays.html in Resources */ = {isa = PBXBuildFile; fileRef = FF149F4920E3C49A0070FECB /* imagesOverlays.html */; };
4141
FF1FD05C20932EDE00186384 /* gutenberg.html in Resources */ = {isa = PBXBuildFile; fileRef = FF1FD05B20932EDE00186384 /* gutenberg.html */; };
42+
FF1FEC7E2406E071006221AA /* underline.html in Resources */ = {isa = PBXBuildFile; fileRef = FF1FEC7D2406E071006221AA /* underline.html */; };
4243
FF5CDACD239E78B200CF235B /* failedMedia.html in Resources */ = {isa = PBXBuildFile; fileRef = FF5CDACC239E78B200CF235B /* failedMedia.html */; };
4344
FF629DC9223BC418004C4106 /* videoShortcodes.html in Resources */ = {isa = PBXBuildFile; fileRef = FF629DC8223BC418004C4106 /* videoShortcodes.html */; };
4445
FF9AF5481DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF9AF5471DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard */; };
@@ -160,6 +161,7 @@
160161
F1D360FC20929E6D00B4E7A5 /* WordPressEditor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = WordPressEditor.xcodeproj; path = ../WordPressEditor/WordPressEditor.xcodeproj; sourceTree = "<group>"; };
161162
FF149F4920E3C49A0070FECB /* imagesOverlays.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = imagesOverlays.html; sourceTree = "<group>"; };
162163
FF1FD05B20932EDE00186384 /* gutenberg.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = gutenberg.html; sourceTree = "<group>"; };
164+
FF1FEC7D2406E071006221AA /* underline.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = underline.html; sourceTree = "<group>"; };
163165
FF5CDACC239E78B200CF235B /* failedMedia.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = failedMedia.html; sourceTree = "<group>"; };
164166
FF629DC8223BC418004C4106 /* videoShortcodes.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = videoShortcodes.html; sourceTree = "<group>"; };
165167
FF9AF5471DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = AttachmentDetailsViewController.storyboard; sourceTree = "<group>"; };
@@ -214,6 +216,7 @@
214216
FF629DC8223BC418004C4106 /* videoShortcodes.html */,
215217
FF5CDACC239E78B200CF235B /* failedMedia.html */,
216218
FFC6772123D07E3E00B76815 /* bigLists.html */,
219+
FF1FEC7D2406E071006221AA /* underline.html */,
217220
);
218221
path = SampleContent;
219222
sourceTree = "<group>";
@@ -465,6 +468,7 @@
465468
59280F2B1D47CAF40083FB59 /* SampleText.rtf in Resources */,
466469
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
467470
FF149F4A20E3C49A0070FECB /* imagesOverlays.html in Resources */,
471+
FF1FEC7E2406E071006221AA /* underline.html in Resources */,
468472
FFC41BDE20DBC7BA004DFB4D /* video.html in Resources */,
469473
FF9AF5481DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard in Resources */,
470474
);

Example/Example/SampleContent/content.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h2>Character Styles</h2>
1313
Underline: <u>Underlined text</u><br/>
1414
Strikethrough: <del>Strikethrough</del><br/>
1515
Colors: <span style="color: royalblue;">Royal Blue by name</span> <span style="color: #ff0000;">Red by hex</span><br/><br/>
16-
Undeline with CSS: <span style="text-decoration: underline;">Alternative underline text</span><br/>
16+
Underline with CSS: <span style="text-decoration: underline;">Alternative underline text</span><br/>
1717
Links: <a href="http://www.wordpress.com">I'm a link!</a><br/> <a href="http://www.wordpress.com" target="_blank">Open in new window link!</a> <br/>
1818
Code: <code>print("Hello world")</code>
1919

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<p><u>Hello&nbsp;world</u></p>
2+
<p><span style="text-decoration: underline;">Alternative&nbsp;underline&nbsp;text</span></p>
3+
<p>Before link <a href="www.wordpress.com">Link&nbsp;to&nbsp;WordPress</a></p>
4+
<p>Before link <a href="www.jetpack.com">Link&nbsp;to&nbsp;Jetpack</a> After link</p>

Example/Example/ViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ViewController: UITableViewController
2121
DemoRow(title: "Video Demo", action: { self.showEditorDemo(filename: "video", wordPressMode: false) }),
2222
DemoRow(title: "Failed Media", action: { self.showEditorDemo(filename: "failedMedia") }),
2323
DemoRow(title: "Big Lists", action: { self.showEditorDemo(filename: "bigLists") }),
24+
DemoRow(title: "Underline NBSP", action: { self.showEditorDemo(filename: "underline")}),
2425
DemoRow(title: "Empty Demo", action: { self.showEditorDemo() })
2526
]
2627
),

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.16.0'
11+
s.version = '1.17.0'
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.16.0'
11+
s.version = '1.17.0'
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)