Skip to content

Commit 8e6f34d

Browse files
committed
1 parent 2f3c735 commit 8e6f34d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

FSNotesCore/Shared/Extensions/NSMutableAttributedString+.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ extension NSMutableAttributedString {
4444
let newRange = NSRange(location: range.location + offset, length: range.length)
4545

4646
guard let unwrappedPath = path, unwrappedPath.count > 0 else { return }
47-
let unrappedTitle = title ?? ""
4847

49-
if let pathEncoded = unwrappedPath.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
48+
let unrappedTitle = title ?? ""
5049

51-
content?.removeAttribute(.attachment, range: newRange)
52-
content?.replaceCharacters(in: newRange, with: "![\(unrappedTitle)](\(pathEncoded))")
53-
offset += 4 + pathEncoded.count + unrappedTitle.count
54-
}
50+
content?.removeAttribute(.attachment, range: newRange)
51+
content?.replaceCharacters(in: newRange, with: "![\(unrappedTitle)](\(unwrappedPath))")
52+
offset += 4 + unwrappedPath.count + unrappedTitle.count
5553
}
5654
}
5755

0 commit comments

Comments
 (0)