Skip to content

Conversation

@hr-xu
Copy link

@hr-xu hr-xu commented Dec 16, 2025

Description

This PR improves the “Xiaohongshu (XHS)” export experience for long Markdown content.

What’s changed

  • XHS mode preview pagination: Long content is automatically paginated in preview with page separators and page number indicators (preview-only).
  • Readable-first pagination rules: Pagination targets a 3:4 reference height with a flexible overflow buffer, and keeps block elements intact (images/tables/code blocks/cards/diagrams are not split across pages; oversized blocks become their own page).
  • Multi-PNG export for XHS mode: Clicking Export PNG in XHS mode exports each page as a separate PNG.
  • ZIP download: Exported PNGs can be bundled into a single ZIP download via JSZip. If JSZip is unavailable, it falls back to downloading PNGs individually.
  • No page indicators in exported images: Page number badges are removed before rendering export images, so exports remain clean.
  • Cache-busting for updated assets: Updated script.js / style.css query params to ensure browsers load the new behavior.

How to test

  1. Start a local static server and open the app in a browser.
  2. Paste long Markdown content (include large images, tables, and code blocks).
  3. Switch to XHS mode and verify the preview shows pagination with separators and page numbers.
  4. Click Export PNG and verify a ZIP file (or multiple PNGs as fallback) is downloaded and pages are in correct order.
  5. Open exported images to confirm no page number badges are rendered in the output.

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