How can I set a SwiftUI Text
to display rendered HTML or Markdown?
Something like this:
Text(HtmlRenderedString(fromString: "<b>Hi!</b>"))
or for MD:
Text(MarkdownRenderedString(fromString: "**Bold**"))
Perhaps I need a different View?
Text
can just display String
s.
You can use a UIViewRepresentable
with an UILabel
and attributedText
.
Probably attributedText text support will come later for SwiftUI.Text
.