gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.44k stars 298 forks source link

Setting a custom font overwrites markdown styles #305

Open peteralt opened 6 months ago

peteralt commented 6 months ago

Describe the bug When I set a custom font for my .text TextStyle, it takes the new font, but any attributes like bold or italic are being overwritten and dismissed.

Sample:

Markdown(text)
    .markdownTextStyle(\.text) {
        FontFamily(.custom(CustomFont.pawp.fontName))
    }

Checklist

Expected behavior I would expect the styling to still apply even with the new custom font.

Version information

Additional context Add any other context about the problem here.