You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ios/HackerNews/Utils/Extensions.swift
+19-18Lines changed: 19 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -13,29 +13,30 @@ extension String {
13
13
// Basic HTML to Markdown conversion that seems to work decently well in testing
14
14
// If we find bugs, maybe move to copying this solution: https://github.com/Dimillian/IceCubesApp/blob/main/Packages/Models/Sources/Models/Alias/HTMLString.swift
15
15
func formattedHTML()->AttributedString{
16
-
// Unescape HTML entities in the entire string before handling links
17
-
varprocessedText=
18
-
self
19
-
.replacingOccurrences(of:"&", with:"&")
20
-
.replacingOccurrences(of:">", with:">")
21
-
.replacingOccurrences(of:"<", with:"<")
22
-
.replacingOccurrences(of:""", with:"\"")
23
-
.replacingOccurrences(of:"'", with:"'")
16
+
varprocessedText=self
24
17
25
-
// Handle links using regex
26
-
// Note: I tried using SwiftSoup at first, but it was having difficulty with edge cases
0 commit comments