gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.25k stars 267 forks source link

Code blocks get truncated #251

Closed moophis closed 9 months ago

moophis commented 10 months ago

Describe the bug When a markdown string contains multiple code blocks and if one of them contains more lines (e.g., 35+ lines of code), other code texts get truncated (with ... at the end of the text). See detailed repro steps below.

Checklist

Steps to reproduce Apply this sample text which contains a couple of code blocks with the last one being the longest to the Demo app CodeSyntaxHighlightView.

Expected behavior All code should be fully visible and no extra top and bottom padding should be applied around the Markdown view. I suspect that the extra paddings are otherwise reserved for these hidden code blocks.

Screenshots See truncated code texts with ... and extra vertical paddings. Simulator Screen Shot - iPad Pro (12 9-inch) (6th generation) - 2023-08-25 at 21 30 03 Simulator Screen Shot - iPad Pro (12 9-inch) (6th generation) - 2023-08-25 at 21 30 11 Simulator Screen Shot - iPad Pro (12 9-inch) (6th generation) - 2023-08-25 at 21 30 15

https://github.com/gonzalezreal/swift-markdown-ui/assets/2663719/5f8a9301-e72c-4cb6-b1a6-598eb8cb629d

Version information

gonzalezreal commented 10 months ago

Hi @moophis,

Thanks for reporting this. The fix is on its way.

gonzalezreal commented 9 months ago

The fix has been released in MarkdownUI 2.2.0