Skip to content

Dev - #15

Merged
atom-tech9 merged 2 commits into
mainfrom
dev
Aug 16, 2026
Merged

Dev#15
atom-tech9 merged 2 commits into
mainfrom
dev

Conversation

@atom-tech9

Copy link
Copy Markdown
Owner

Summary

Type of Change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — code change that neither fixes a bug nor adds a feature
  • chore — tooling / maintenance
  • test — adding or updating tests
  • perf — performance improvement
  • ci — CI / build changes

Screenshots

Checklist

  • npm run typecheck passes
  • npm run lint passes
  • npm run build passes
  • Follows the project code style (no any, immutable updates, logical CSS)
  • i18n keys added for any new user-facing strings (en and ar)
  • RTL layout verified for UI changes
  • No console.log (uses @/lib/logger)
  • Documentation updated if needed

`.task-list-item { display: flex }` promoted every inline child of a
checklist item to a flex item, so bold runs and inline code each became
their own column; `word-break: break-word` on inline code then let those
items shrink to min-content — one character wide. Replaced with normal
inline flow and a hanging checkbox (negative margin-inline-start), which
also fixes nested checklists rendering as sibling columns, plain bullets
losing their markers beside task items, ordered checklists losing their
numbering (a flex item is not a list-item, so the counter never
advanced), block children sitting beside the checkbox, and long URLs
running off the page.

Code blocks:
- `pre { overflow-x: auto }` made every block a scroll container, which
  is monolithic under CSS fragmentation — so `break-inside` was ignored
  and a tall block could never split, it was pushed whole to the next
  page and then clipped. Removed, and lines now wrap (`pre-wrap`) with
  continuations hanging past the line-number gutter, so nothing is cut
  off at the right margin.
- Splitting exposed a Paged.js defect that blanks the line straddling a
  page edge, so the export instead cuts long listings into page-sized
  atomic pieces (chunkCodeBlocks) that join seamlessly; Paged.js only
  ever places whole blocks.

Tables: type and padding step down at 6+ and 8+ columns, and only long
tokens and URLs may break, so headers stay whole rather than reading
"Platfor / m". Also gives callout bodies `min-width: 0` and lets links
break anywhere, so neither overflows the page box.

Stops two leaks into exported files: the Copy button was printed into
every PDF, and every checkbox carried `node="[object Object]"` into the
preview DOM, the standalone HTML export and the PDF.

Verified by rendering checklist, wide-table, deep-nesting and RTL Arabic
fixtures through the real pipeline and Paged.js in headless Chrome: no
element extends past the page content box and the code-line sequence
matches the source exactly.
…rness

Adds author control over pagination and closes the remaining ways content
could be silently clipped in a PDF.

Directives (remarkPageDirectives):
- ::page-break starts the next block on a fresh page
- :::keep-together never splits a run across a page boundary
- :::landscape puts a run on its own rotated page, via a named @page
  sized from the configured paper

Content that cannot reflow:
- fitToPage runs after pagination and scales down anything still wider
  than its page — display math, diagrams, ASCII figures, code. Reduces
  type size rather than applying a transform, so the element's box
  shrinks too; a transform would leave the original height as a gap.
  Shrinking only frees vertical space, so the laid-out pages stay valid.
  This closes the KaTeX clipping bug: .katex-display had the same
  overflow-x scroll-container trap that hid the code-block bug.
- Tables past 10 columns stack into one labelled block per row
  (stackWideTables); the header text has to be copied onto the body
  cells as an attribute because CSS cannot reach across rows.
- renderPagedPreview returns fit: { scaled, clipped } so the UI can warn
  when something was still too wide at the minimum scale.

Export transforms now live behind prepareForPaging, so the regression
suite runs exactly what the export runs rather than a copy that can drift.

The standalone HTML export inlined KaTeX CSS instead of linking a CDN: if
that CDN was unreachable, .katex-mathml stopped being hidden and every
equation rendered twice, once typeset and once as raw MathML. The Word
export gains the same stylesheet, so math survives there too.

tests/visual renders fixtures through the real pipeline and paginator and
asserts no element leaves the page content box, the rendered code-line
sequence matches the source, and no line is blank where the source has
content. Opt-in for now (SCRIPTO_VISUAL=1) — headless Chrome's --dump-dom
races Paged.js's async layout under a virtual time budget. Two findings
are captured in docs/RENDERING_AUDIT.md: Paged.js preloads every
@font-face and stalls silently when one cannot load, and PagedConfig
before/after are the supported hooks.
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
scripto Building Building Preview Aug 16, 2026 10:21am

Request Review

@atom-tech9
atom-tech9 merged commit bc6eba0 into main Aug 16, 2026
2 of 3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7c170d73 Deployed Aug 16, 2026 by vercel[bot]
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