Skip to content

fix(shared): preserve image blocks during markdown/html round-trip#5549

Merged
rebelchris merged 11 commits intomainfrom
eng-779-images-become-broken-links-after-editing-post-content
Feb 23, 2026
Merged

fix(shared): preserve image blocks during markdown/html round-trip#5549
rebelchris merged 11 commits intomainfrom
eng-779-images-become-broken-links-after-editing-post-content

Conversation

@rebelchris
Copy link
Contributor

@rebelchris rebelchris commented Feb 23, 2026

Summary

  • fix markdown-to-HTML conversion so standalone markdown image lines render as top-level <img /> blocks instead of being wrapped in <p>
  • add/strengthen markdown conversion tests to cover standalone image round-trips, image-between-paragraphs, and inline image behavior

Key Decisions

  • treat only full-line markdown image syntax as standalone blocks using an anchored regex, so inline images in text remain paragraph content
  • reuse existing inlineMarkdownToHtml conversion for standalone image rendering to avoid duplicated parsing/escaping logic
  • tighten the existing image assertion from .toContain() to .toBe() to prevent masking paragraph-wrapping regressions

Closes ENG-779


Created by Huginn 🐦‍⬛

Preview domain

https://eng-779-images-become-broken-lin.preview.app.daily.dev

@rebelchris rebelchris requested a review from a team as a code owner February 23, 2026 13:00
@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Feb 23, 2026 1:16pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Feb 23, 2026 1:16pm

Request Review

@rebelchris rebelchris merged commit e517493 into main Feb 23, 2026
11 checks passed
@rebelchris rebelchris deleted the eng-779-images-become-broken-links-after-editing-post-content branch February 23, 2026 13:18
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.

3 participants