Dev - #8
Merged
Merged
Dev#8
Conversation
… view Replaces the linear scrollTop-fraction sync (which drifted badly on tables/images/code, since a source line and its rendered block have wildly different heights) with source-line anchoring, the technique used by VS Code/Typora/Obsidian: - rehypeSourceLine stamps data-source-line on block elements (runs before rehype-raw so mdast positions survive) - parseFrontmatter exposes bodyLineOffset so editor lines (which include front-matter) map to body-relative preview lines - useScrollSync maps a fractional source line between panes and interpolates between anchors; the pane the user physically scrolls is the driver, the other follows — programmatic follower scrolls never bounce back (input-keyed lock, not a fragile timeout) - bidirectional: scrolling the preview now moves the editor too - a Link2/Link2Off toggle in the preview (split view only), persisted to scripto:scroll-sync Verified end to end on a table-heavy doc: the same paragraph stays aligned on both sides in both directions.
A flowchart TD taller than the page rendered fine in the (scrollable)
preview but exploded to 5+ pages in the PDF: an unbreakable element
taller than the page content box makes Paged.js fail to place it, and
when it splits a Mermaid SVG the diagram's inner <style> leaks as
visible '#mermaid-1{...}' text on the overflow pages.
The export CSS now caps figure/diagram/image height to the page's
content box minus a buffer for the preceding heading (headings carry
break-after: avoid) and the figure's own margins, with width:auto so
the aspect ratio is preserved. Oversized diagrams scale down to fit
one page intact; normal-sized ones are untouched. Verified: the 8-node
stack went from 7 export pages to 1, no style-text leak.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
feat— new featurefix— bug fixdocs— documentation onlyrefactor— code change that neither fixes a bug nor adds a featurechore— tooling / maintenancetest— adding or updating testsperf— performance improvementci— CI / build changesScreenshots
Checklist
npm run typecheckpassesnpm run lintpassesnpm run buildpassesany, immutable updates, logical CSS)console.log(uses@/lib/logger)