Skip to content

Commit 0292487

Browse files
Merge pull request #538 from wordpress-mobile/issue/487_fix_emoji
Issue/487 fix emoji
2 parents 8485907 + 0b46bd5 commit 0292487

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Aztec/Classes/Extensions/String+EndOfLine.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ extension String {
2121
/// - Returns: `true` if the specified offset is in an empty paragraph, `false` otherwise.
2222
///
2323
func isEmptyParagraph(at offset: Int) -> Bool {
24-
25-
let index = self.index(startIndex, offsetBy: offset)
24+
guard let index = self.indexFromLocation(offset) else {
25+
return true
26+
}
2627

2728
return isEmptyParagraph(at: index)
2829
}

0 commit comments

Comments
 (0)