-
Notifications
You must be signed in to change notification settings - Fork 510
Description
Thank you for contributing to MarkdownUI!
Before you submit an issue, please complete the report with all the relevant details for your bug and go through every item in the checklist.
Describe the bug
A clear and concise description of what the bug is.
Using MarkdownUI with Splash causes a crash on a long-ish markdown on app launch.
Checklist
- [ ✅] I can reproduce this issue with a vanilla SwiftUI project.
- [ ✅ ] I can reproduce this issue using the
mainbranch of this package. - [ ✅] This bug hasn't been addressed in an existing GitHub issue.
Steps to reproduce
Explanation of how to reproduce the incorrect behavior. This could include an attached project, a link to code, or a Markdown-formatted text exhibiting the issue.
- Run the attached app on a physical device and the app will crash on startup.
- The stacktrace that Xcode shows for the crash points to
@maininMarkdownScrollViewCrashApp, but I've narrowed it down toBuilder'sbuildmethod.
Expected behavior
A clear and concise description of what you expected to happen.
- App should not crash on startup and markdown should render.
Screenshots
If applicable, add screenshots to help explain your problem.
Version information
- MarkdownUI: 2.1.0
- OS: iOS 16.4 (running on a physical device, not a simulator)
- Xcode: 14.3
Additional context
Add any other context about the problem here.
If you reduce the size of the sample text, the markdown renders correctly. From my debugging, I've found that
accumulatedText.reduce(Text(""), +) in TextOutputFormat is the culprit. I suspect that the memory of the underlying text storage is being released leading to a bad access.
Sample project - MarkdownScrollViewCrash.zip