Skip to content

Fix captioned Markdown image rendering - #31

Open
grapeot wants to merge 2 commits into
masterfrom
fix-markdown-caption-images
Open

Fix captioned Markdown image rendering#31
grapeot wants to merge 2 commits into
masterfrom
fix-markdown-caption-images

Conversation

@grapeot

@grapeot grapeot commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Normalize standalone Markdown image lines before rendering when the next line contains caption/text.
  • Apply the normalizer in File Preview, Chat message rendering, and Reasoning cards.
  • Keep true inline images unchanged.
  • Add unit tests covering caption separation, already-separated image blocks, and true inline images.
  • Update docs/working.md.

Root cause

When Markdown is written as:

![image](url)
*caption*

with no blank line, Markdown renderers can treat the image as an inline image in the same paragraph. That bypasses the block-image rendering path and can produce incorrect sizing.

Test plan

  • ./gradlew testDebugUnitTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant