Skip to content

Commit

Permalink
Unescape the markdown version too
Browse files Browse the repository at this point in the history
The HTMLString.asMarkdown string is now also unescaped, & and
similar are resolved.
  • Loading branch information
Havhingstor committed May 13, 2024
1 parent 5d51073 commit cd36b4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Packages/Models/Sources/Models/Alias/HTMLString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public struct HTMLString: Codable, Equatable, Hashable, @unchecked Sendable {
return
} else if node.nodeName() == "#text" {
var txt = node.description


txt = (try? Entities.unescape(txt)) ?? txt

if let underscore_regex, let main_regex {
// This is the markdown escaper
txt = main_regex.stringByReplacingMatches(in: txt, options: [], range: NSRange(location: 0, length: txt.count), withTemplate: "\\\\$1")
Expand Down

0 comments on commit cd36b4c

Please sign in to comment.