Open kevinrenskers opened 4 years ago
Also seeing this issue
Yes this is currently a limitation with SwiftUI. As soon as we add a modifier to text to allow for a clickable link, it becomes a view and we can no longer compose the text. So in this case links become their own line. We could fix this by dipping into UIKit for the links.
Unfortunately I don’t have a ton of time to look at this at the moment, but contributions are welcome!
I had a go at writing my own CommonMark Text widget in SwiftUI and also hit this problem, as Andre mentioned it is due to the way SwiftUI works, hopefully we get more support for attributed strings in SwiftUI 2.0 or even a wrap around stack which means we could mix Buttons and Text.
@acarrera94 that makes sense, thanks for the response 👍🏻
This is how the text is supposed to be laid out:
But this is what happens to links: