LiYanan2004 / MarkdownView

Rendering Markdown text natively in SwiftUI.
https://liyanan2004.github.io/MarkdownView/documentation/markdownview/
MIT License
195 stars 18 forks source link

Remove font attribute in CodeBlockView #31

Closed aheze closed 4 months ago

aheze commented 4 months ago

Before, there was a noticeable jump from unhighlighted → highlighted

https://github.com/user-attachments/assets/ce78555c-ef27-44a7-997c-689c50ebc11e

By removing the font attribute, the .font(font.codeBlock) modifier is respected for both highlight states. We can remove the animation because there is no longer any discontinuity.

Highlighted swift code block

LiYanan2004 commented 4 months ago

Good work @aheze