AttributedString markdown missing elements in Swift

Not all markdown elements work. The string will work if I do:

  • "hello world" Italics
  • "hello world" Bold

But NOT

  • "hello world" Bold & Italics

There are others that also don't work such as headers and numbered lists.

        let string: String = "***hello world***"

        if let attributedString: AttributedString = try? AttributedString(markdown: string) {

            let attributedText: NSMutableAttributedString = NSMutableAttributedString(attributedString)

            myLabel.text = nil
            myLabel.attributedText = attributedText
        }

Parsing a markdown string such as ***hello world*** should produce a "hello world" string that is both emphasized (italic) and strongly emphasized (bold) via the inlinePresentationIntent attribute. If you're seeing behavior that doesn't seem correct here (such as attributes missing from the created AttributedString), could you file a request via Feedback Assistant with a sample project to demonstrate the issue so that we can take a look? (and please link the feedback number here for reference)

Submitted to feedback assistant - #FB9935141

I see the same behavior in iOS 16, do we have an update to this?

This is still an issue. Tested it myself today. Bold + Italic and headers were not working.

AttributedString markdown missing elements in Swift
 
 
Q