-
Notifications
You must be signed in to change notification settings - Fork 459
Description
Describe the bug
Markdown images using [](link-url) or [title](url)
only render correctly if they are surrounded by blank lines. If the image is inline with text, or immediately follows a text line without a blank line, it does not render at all.
Checklist
- I can reproduce this issue with a vanilla SwiftUI project.
- I can reproduce this issue using the
main
branch of this package. - This bug hasn't been addressed in an existing GitHub issue.
Steps to reproduce
Use the following Markdown in a Markdown view:
**Rosemary** - Evergreen herb with needle-like leaves and blue flowers: [](https://www.epicgardening.com/container-rosemary/)
**Oregano** - Bushy herb with small oval leaves, spreads nicely:
[](https://meadowlarkjournal.com/blog/growing-oregano-in-a-pot)
**Marigolds** - Bright orange and yellow blooms, compact and cheerful:
[](https://tonkadale.com/blog/container-gardening-for-all-season-color/)
- Run the app.
- Observe that the Rosemary and Oregano images do not render, while the Marigolds image does.
- Adding a blank line before the image fixes the rendering.
Expected behavior
Images should render correctly regardless of whether they are inline with text or immediately follow text without blank lines.
Screenshots
Here’s an example where the first two images fail to render, but the last one (with a blank line before it) renders correctly:

Version information
- MarkdownUI: [e.g. 2.0.0, or a commit hash]
- OS: [e.g. iOS 15, macOS 13]
- Xcode: [e.g. 14.2.0]
Additional context
It seems that the Markdown parser currently requires block separation (blank lines) around images for them to render. Inline image + link syntax should ideally render without needing additional whitespace.