Skip to content

feat(renderer): update the vendored document renderer - #94

Merged
usamaiqb merged 1 commit into
mainfrom
feat/update-vendored-renderer
Nov 15, 2026
Merged

usamaiqb merged 1 commit into
mainfrom
feat/update-vendored-renderer

Conversation

@usamaiqb

Copy link
Copy Markdown
Owner

Re-vendors the shared renderer from markreader-desktop main (33a3c95), 28 commits on from the copy this app carried.

The module graph grew, so the generated set gains scroll.js, mermaid/subgraphTitles.js, mermaid/vsCodeTheme.js and markdown-language-features/util/dom.js. The desktop shell, its tabs, the test stub and three type-only modules are still not copied; MANIFEST.md lists them, and the notices name the new files derived from VS Code.

Three things change for a reader:

  • Find keeps the reading position while typing. A query paints and counts its matches and marks the nearest one; Enter and next/previous are what move.
  • Mermaid diagrams take VS Code's theme, and subgraph titles sit clear of the edges that enter them.
  • Heading anchors are gone, and local images written as raw HTML are resolved the way Markdown images are.

The host has to keep up with two of the renderer's changes:

  • The reading line and the headroom above a revealed heading are now measured from the top of the scroll area, less whatever the host says it draws over. The page gains setCoveredTop, fed the top bar's live height, so a heading picked from the contents lands below the bar rather than under it. The editor preview puts it back to zero, as it does the content inset.
  • An export passes the engine's resource resolver to the sanitizer, so raw HTML images are inlined like Markdown ones. Every other attribute the renderer points at this host (srcset, a source, a video and its poster) is dropped, so no app-origin URL leaves in a shared file.

Closes #67

Re-vendors the shared renderer from markreader-desktop main (33a3c95),
28 commits on from the copy this app carried.

The module graph grew, so the generated set gains scroll.js,
mermaid/subgraphTitles.js, mermaid/vsCodeTheme.js and
markdown-language-features/util/dom.js. The desktop shell, its tabs, the
test stub and three type-only modules are still not copied; MANIFEST.md
lists them, and the notices name the new files derived from VS Code.

Three things change for a reader:

- Find keeps the reading position while typing. A query paints and
  counts its matches and marks the nearest one; Enter and next/previous
  are what move.
- Mermaid diagrams take VS Code's theme, and subgraph titles sit clear
  of the edges that enter them.
- Heading anchors are gone, and local images written as raw HTML are
  resolved the way Markdown images are.

The host has to keep up with two of the renderer's changes:

- The reading line and the headroom above a revealed heading are now
  measured from the top of the scroll area, less whatever the host says
  it draws over. The page gains setCoveredTop, fed the top bar's live
  height, so a heading picked from the contents lands below the bar
  rather than under it. The editor preview puts it back to zero, as it
  does the content inset.
- An export passes the engine's resource resolver to the sanitizer, so
  raw HTML images are inlined like Markdown ones. Every other attribute
  the renderer points at this host (srcset, a source, a video and its
  poster) is dropped, so no app-origin URL leaves in a shared file.

Refs #67
@usamaiqb usamaiqb self-assigned this Nov 14, 2026
@usamaiqb
usamaiqb merged commit fb6b32d into main Nov 15, 2026
3 checks passed
@usamaiqb
usamaiqb deleted the feat/update-vendored-renderer branch November 15, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: Disable search while typing

1 participant