I've seen other questions on here asking about text markdown not displaying in Swift but nothing directly related to AWS Amplify. I've tried the solutions such as the one linked below but nothing has worked so far.
SwiftUI Text Markdown dynamic string not working
I'm using AWS Amplify to send news articles to my app and the text body of the article is formatted as an optional string. Here is how it is setup in my Model:
public struct Article: Model {
public var body: String?
I've tried using
Text(.init(article.body ?? "Body"))
and
Text(try! AttributedString(markdown: article.body ?? "Body"))
But each method doesn't seem to work. Below is a snippet of the text body that I'm trying to have display new lines.
The Cubs defeated the Reds 4-2 in the second-ever Field of Dreams MLB game in Iowa, and both teams relished the experience.\n\nThe Cubs won MLB's 2022 Field of Dreams game over the Reds 4-2. Here is a look at the best moments from Thursday's action.
Before integrating AWS Amplify I was testing with local JSON files that I was loading into my app and the formatting was displaying properly.
What am I missing and/or not understanding?