Skip to content

feat(Markdown): preserve image titles - #6657

Closed
ernestt wants to merge 2 commits into
markdown-upgrade/01-loose-fencesfrom
markdown-upgrade/02-image-titles
Closed

ernestt wants to merge 2 commits into
markdown-upgrade/01-loose-fencesfrom
markdown-upgrade/02-image-titles

Conversation

@ernestt

@ernestt ernestt commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

User need

Markdown image titles now reach both the default <img> output and custom image renderers across inline, reference, transformed, and streamed documents.

Problem and solution fit

The parser reduced link definitions and inline destinations to URLs, discarding optional image-title metadata before rendering. Preserving the title in the canonical AST closes that loss without changing URL safety or default images without titles.

Current specification

The Markdown canonical-AST and renderer replacement contracts in the component contract and AST-036. Pinned source.

Public delta and caller burden

Add optional image-title data through parser, AST, plugin, Remark, public-type, renderer, and streaming projections. Existing title-free images remain unchanged.

Design and alternatives

The capability is explicit and opt-in where it changes syntax, rendering, or package weight. Existing defaults and replacement seams remain compatible; broader alternatives stay outside this PR.

Evidence

Real-browser evidence

Image title before and after

Focused behavior and compatibility coverage ships with the implementation.

Scope

  • One capability is added.
  • Unrelated fixes and policy changes were split into adjacent stack entries.
  • Consumer docs and focused tests ship with the feature.
  • Public text and artifacts contain no internal context.

Testing

  • Focused: Parser, AST, Remark, plugin protocol, streaming, public API, and renderer tests.
  • Stack head: pnpm exec vitest run packages/core/src/Markdown packages/core/src/CodeBlock — 37 files, 760 tests.
  • Stack head: pnpm --filter @astryxdesign/core typecheck.
  • Repository checks: pnpm check:repo.

Stack

Previous: #6656 · Next: #6658 · Each PR is intentionally one commit and one primary intent.

@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 26, 2026 3:09pm UTC

Request Review

@ernestt ernestt mentioned this pull request Sep 26, 2026
4 tasks done
@astracat-bot

astracat-bot Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
📝 Draft — not reviewed automatically (for maintainers only) Sep 28, 2026, 6:29 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 26, 2026
@ernestt

ernestt commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

@cixzhang — I’d appreciate your feedback on this draft.

Focus: Markdown image titles now reach both the default <img> output and custom image renderers across inline, reference, transformed, and streamed documents.

This is PR 2/20 in the linked Markdown stack. It is intentionally one commit and one primary intent; the description includes matched before/after screenshots and previous/next links, so you can review just this PR’s delta.

@humbertovirtudes humbertovirtudes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three issues block approval. The image-resource scans repeatedly call a backwards-looking isEscaped(), making long backslash runs quadratic; track escape parity during each forward scan. Streaming also treats a title-closing parenthesis as the image close, which can expose raw Markdown before the final character. Finally, the rendering test covers only a standalone image, so please add inline native and custom-renderer title coverage plus character-by-character streaming cases.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 27, 2026
@ernestt
ernestt added this pull request to stack #6700 September 28, 2026 18:02
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox are not both ready on the exact-head Vercel preview.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

1 of 420 shot(s) changed. View the report

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
SideNav Resizable in AppShell probe dark 3,208
SideNav — Resizable in AppShell — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

Generated by PR Enrichment workflow | View full report

@ernestt ernestt closed this Oct 9, 2026
@github-actions
github-actions Bot deleted the markdown-upgrade/02-image-titles branch October 10, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — fe6ac787 Deployed Sep 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants