Skip to content

Fix imageConfig being dropped by MarkdownRenderConfig builders - #179

Open
Vincent Peng (vincent-peng) wants to merge 1 commit into
microsoft:mainfrom
vincent-peng:builder-imageconfig-forwarding
Open

Vincent Peng (vincent-peng) wants to merge 1 commit into
microsoft:mainfrom
vincent-peng:builder-imageconfig-forwarding

Conversation

@vincent-peng

Copy link
Copy Markdown
Contributor

Summary

Every with… builder on MarkdownRenderConfig constructs a fresh config and is responsible for forwarding each field. Six builders were missing imageConfig: in the forwarded initializer, so chaining them after .withImageConfig(...) silently reset the image configuration to .default (disabled).

This change forwards imageConfig in the builders that were missing it. Issue #173 tracks the broader builder-API redesign; this keeps the diff to the minimal bug fix.

Validation

  • make lint — 0 violations (strict)
  • make test — full package suite passes, including a new MarkdownRenderConfigBuilderTests suite asserting every with… builder preserves imageConfig

OSS readiness

  • No public API change — pure bug fix.
  • Regression tests cover all with… builders.

Refs #173

Every withXxx builder except withImageConfig omitted the imageConfig
parameter, silently resetting it to .disabled whenever a consumer
customized any other config field after enabling images. Forward the
existing value so builders compose correctly.

Refs microsoft#173

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vincent-peng
Vincent Peng (vincent-peng) requested review from a team and a balanced review from Copilot October 8, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vincent-peng

Copy link
Copy Markdown
Contributor Author

Independent verification: PASS (verified against the real artifact by an agent that did not write the code, on detached worktree 16bc315)

  • swiftlint --strict: 0 violations, 0 serious in 141 files
  • Package tests: 120 executed, 0 failures — includes MarkdownRenderConfigBuilderTests.test_builders_preserve_image_config
  • make build-sample: ** BUILD SUCCEEDED **
  • Warnings observed are pre-existing in files untouched by this diff (CodeBlockView.swift, SnapshotTestCase.swift, ViewImageConfig.swift)

Vincent Peng (vincent-peng) added a commit to vincent-peng/SwiftStreamingMarkdown that referenced this pull request Oct 8, 2026
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.

2 participants