When I display an attributedString value using markdown, in a UITextView of my iOS app, the linebreaks are being ignored.
The display I get is
I've tried different linebreak syntax in the markdown text, \n\n, \r\n\r\n, etc., but I can't find a way to produce linebreaks in the display.
Is the problem with the syntax in my string constant? Is the problem occurring when the AttributedString is converted to an NSAttributedString? What's the solution?
Swift:
do {
let attributedString = try AttributedString(markdown: "**Heading**\n\nBody")
uiTextView.attributedText = NSAttributedString(attributedString)
}
The display I get is
HeadingBody
I've tried different linebreak syntax in the markdown text, \n\n, \r\n\r\n, etc., but I can't find a way to produce linebreaks in the display.
Is the problem with the syntax in my string constant? Is the problem occurring when the AttributedString is converted to an NSAttributedString? What's the solution?