Closed BeBeBerr closed 8 months ago
Hi @BeBeBerr,
What is happening is that the current theme is applying the fixedSize(horizontal: false, vertical: true)
on the paragraph contents.
You can workaround this issue by overriding the current paragraph style. For instance:
struct ContentView: View {
var body: some View {
Markdown("1232313123123123131312323131231231231313123231312312312313131232313123123123131312323131231231")
.markdownBlockStyle(\.paragraph) { configuration in
configuration.label
.relativeLineSpacing(.em(0.15))
.markdownMargin(top: .zero, bottom: .em(1))
}
.border(Color.pink)
.padding()
}
}
Thanks for replying! Is this considered as a bug and is there any plans to fix it? @gonzalezreal
I am not sure this is a bug. It can be argued what is best as the default behaviour. There were multiple bugs in the past related to not applying the fixedSize(horizontal: false, vertical: true)
modifier by default in the themes that come with MarkdownUI, like #251 or #219.
Describe the bug When text is long, the window is expanded with extra space and cannot be resized. However, if the text is short, everything is fine.
Checklist
main
branch of this package.Steps to reproduce When text is very long:
The layout becomes weird. The window is actually way longer than my screen and I couldn't capture the whole window.
However, if I delete some text, everything is fine and I can resize the window with no issue.
Version information
This issue is introduced in version 2.0.0. Version 1.1.1 has no such issue. Any help will be appreciated!