This class represents an HTML string. It can be used to create an AttributedString for displaying HTML text.
import HTMLString
struct MyStruct: Codable {
var html: HTMLString?
}
struct MyView: View {
let myStruct : MyStruct
var body: some View {
if let html = myStruct.html?.asSafeMarkdownAttributedString {
Text(html)
}
}
}
This code was originally extracted from IceCubesApp
Unescape entities. RawText and markdownText no loger have escaped entities like &
Added HTMLString(html:String) intializer for intializing from a HTML string.
Upped iOS and related version minimum to 15 (the actual API at which AttributedString is available.)
- Dropped iOS and related version minimum to 13.
- Recognize and tags.
- Limited support for
tag.
- Switched Package version to 5.7 (to work with Swift 5.7).
First version.