You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before you submit an issue, please complete the report with all the relevant details for your bug and go through every item in the checklist.
Describe the bug
If the code block is very long (this example contains 697 lines) and matches a certain pattern (for example, the first line is long), then the code block is not rendered. It just outputs an empty block.
Checklist
I can reproduce this issue with a vanilla SwiftUI project.
I can reproduce this issue using the main branch of this package.
Assign this long string (given at the bottom of this comment) to longText and use Markdown(longText) to see the effect. The code block isn’t rendered. Screenshot:
But if I use a custom style without using ScrollView(.horizontal), as follows:
Markdown(longText).markdownBlockStyle(\.codeBlock){ configuration in
configuration.label
.fixedSize(horizontal: false, vertical: true).relativeLineSpacing(.em(0.15)).markdownTextStyle{FontFamilyVariant(.monospaced)}.padding(10).frame(maxWidth:.infinity, alignment:.leading).background(.black.opacity(0.1)).markdownMargin(top:.zero, bottom:.em(1))}
It’s rendered:
This is the longText:
let longText = """
This is a code block:
```
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
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a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
```
"""
Markdown(longText)
Expected behavior
I expect the code block to be rendered when using the default theme (with horizontal scroll view).
Version information
MarkdownUI: 2.3.1
OS: iOS 17.5.1, macOS 15.0 beta 2
Xcode: 16.0 beta 2
The text was updated successfully, but these errors were encountered:
Thank you for contributing to MarkdownUI!
Before you submit an issue, please complete the report with all the relevant details for your bug and go through every item in the checklist.
Describe the bug
If the code block is very long (this example contains 697 lines) and matches a certain pattern (for example, the first line is long), then the code block is not rendered. It just outputs an empty block.
Checklist
main
branch of this package.Steps to reproduce
Assign this long string (given at the bottom of this comment) to
longText
and useMarkdown(longText)
to see the effect. The code block isn’t rendered. Screenshot:But if I use a custom style without using
ScrollView(.horizontal)
, as follows:It’s rendered:
This is the
longText
:Expected behavior
I expect the code block to be rendered when using the default theme (with horizontal scroll view).
Version information
The text was updated successfully, but these errors were encountered: