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
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]
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
mainbranch of this package.Steps to reproduce
.markdownSoftBreakMode(.lineBreak)Expected behavior
The whitespace between the text and inline-styled elements should be preserved.
Screenshots
Version information