Skip to content

Commit

Permalink
fix: crash on iOS18 by reversing enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzihao committed Sep 19, 2024
1 parent 73e145f commit 93f3f45
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ extension MarkupNSAttributedStringVisitor {

// merge tag Boundary Breakline, e.g. </p></div> -> /n/n -> /n
var pre: (NSRange, NSAttributedString.Key.BreaklinePlaceholder)?
mutableAttributedString.enumerateAttribute(.breaklinePlaceholder, in: NSMakeRange(0, totalLength)) { value, range, _ in
mutableAttributedString.enumerateAttribute(.breaklinePlaceholder, in: NSMakeRange(0, totalLength), options: .reverse) { value, range, _ in
if let breaklinePlaceholder = value as? NSAttributedString.Key.BreaklinePlaceholder {
if range.location == 0 {
mutableAttributedString.deleteCharacters(in: range)
Expand Down

0 comments on commit 93f3f45

Please sign in to comment.