I can get to the code blocks if I do this:
| var aString: AttributedString = try? AttributedString(markdown: m) |
| |
| for r in aString.runs { |
| if let pi = r.presentationIntent { |
| for i in pi.components { |
| } |
| } |
| } |
But - then I lose all the new line characters in my initial string.
So I can preserve the new line characters like this:
var aString: AttributedString = try? AttributedString(markdown: m, options: AttributedString.MarkdownParsingOptions(interpretedSyntax: .inlineOnlyPreservingWhitespace))
But - now there are no code block annotations.
Is there a way that I can preserve new lines AND get code block annotations? I need the code block annotations so I can set my own formatting. (At least until Apple renders code blocks properly).