AttributedString with Markdown not rendering in Text in SwiftUI?

I assumed this was a beta 1 or 2 bug, but as of beta 4 I'm still seeing this behavior, so perhaps I'm doing something wrong:

Text is supposed to render AttributedStrings with Markdown. It appears to render correctly when a direct String literal is passed into the Text, but not when the AttributedString is a variable. Am I doing something super dumb?

struct ContentView: View {
    var text = AttributedString("**Hello**, `world`! Visit our [website](https://www.capitalone.com).")

    var body: some View {
        VStack {
            Text("**Hello**, `world`! Visit our [website](https://www.capitalone.com).")
                .padding()

            Text(text)
                .padding()
        }
    }
}

Answered by BabyJ in 683391022

AttributedString needs to be initialised with the markdown parameter.

So change the variable to this:

var text = try AttributedString(markdown: "**Hello**, `world`! Visit our [website](https://www.capitalone.com).")
Accepted Answer

AttributedString needs to be initialised with the markdown parameter.

So change the variable to this:

var text = try AttributedString(markdown: "**Hello**, `world`! Visit our [website](https://www.capitalone.com).")
AttributedString with Markdown not rendering in Text in SwiftUI?
 
 
Q