- 
                Notifications
    
You must be signed in to change notification settings  - Fork 479
 
Open
Description
There's a whitespace collapsing bug where inline-styled elements (links, bold, italic, strikethrough) lose their trailing spaces in .lineBreak mode, causing adjacent text to run together without proper spacing.
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
- enable softline break mode:  
.markdownSoftBreakMode(.lineBreak) 
struct ContentView: View {
    var body: some View {
        VStack {
            Markdown {
"""
Begining text
[Link](https://www.example.com) without spaces after?
**Emphasis Text** seems to run together ?
***what*** about strong emphasis?
~~strikethrough~~ are also running running together!
`inline code` is not working?
"""
            }
            .markdownSoftBreakMode(.lineBreak)
        }
        .padding()
        .frame(height: 200)
    }
}Expected behavior
The whitespace between the text and inline-styled elements should be preserved.
Screenshots
Version information
- MarkdownUI: [2.4.1]
 - OS: [macOS 15]
 - Xcode: [16.2]
 
Metadata
Metadata
Assignees
Labels
No labels