Skip to content

[codex] Fix exported document centering#159

Merged
ThisIs-Developer merged 1 commit into
mainfrom
codex/fix-export-centered-layout
Jun 4, 2026
Merged

[codex] Fix exported document centering#159
ThisIs-Developer merged 1 commit into
mainfrom
codex/fix-export-centered-layout

Conversation

@ThisIs-Developer
Copy link
Copy Markdown
Owner

Summary

  • Fixes HTML not centered #152 by making exported HTML fit its rendered Markdown content before settling the page width.
  • Removes the exported document body's default browser margin so the centered article aligns predictably.
  • Applies the same content-fit measurement before PDF capture so wide custom layouts are included instead of clipped.

Root Cause

The live preview uses the available preview pane width, but exported HTML forced .markdown-body into a GitHub-style max-width: 980px container with the browser's default body margin still applied. Markdown documents that include wider custom layouts, such as a two-column CSS grid, could overflow that fixed article box. The HTML then appeared offset, and the PDF capture used the narrower box, leaving the overflowing right side outside the page.

User Impact

Wide exported documents now stay centered as a single document surface. If content needs more than the default 980px article width, the export widens the article to fit it; PDF export then captures that full width and scales it onto the page.

Validation

  • node --check script.js
  • git diff --check
  • Local browser layout check against the provided exported sample document with the new fitting behavior.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

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

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment Jun 4, 2026 8:12pm

@ThisIs-Developer ThisIs-Developer marked this pull request as ready for review June 4, 2026 21:12
@ThisIs-Developer ThisIs-Developer merged commit 8824493 into main Jun 4, 2026
6 checks passed
@ThisIs-Developer ThisIs-Developer deleted the codex/fix-export-centered-layout branch June 4, 2026 21:12
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.

HTML not centered

1 participant