swift-markdown-ui
swift-markdown-ui copied to clipboard
[Crash] Crash when rendering string of `Array(repeating: "hello,\n", count: 250).joined()`
Describe the bug
I found that using Markdown with a string containing 250 \n
characters causes a crash. Paste the following code into the Demo project under the Repo to reproduce.
struct CodeView: View {
var body: some View {
DemoView {
Markdown(Array(repeating: "hello,\n", count: 250).joined())
}
}
}
Below is the crash screenshot. In the SwiftUI project, I am unable to determine the specific cause. If there are any good debugging methods, please let me know.
Could you please attach the crash screenshot here? Additionally, if you could provide more details about the error message or the context in which the crash occurs, it would help in suggesting effective debugging methods for your SwiftUI project.
Checklist
- [x] I can reproduce this issue with a vanilla SwiftUI project.
- [x] I can reproduce this issue using the
main
branch of this package. - [x] This bug hasn't been addressed in an existing GitHub issue.
Steps to reproduce
- Copy the code from the description into ContentView in the Demo project.
- Run the project.
- A crash occurs.
Expected behavior
I hope to resolve this crash as soon as possible. If needed, I can offer assistance.
Version information
- MarkdownUI: 2.3.0
- iOS: 17.4.1
- Xcode: 15.2