Skip to content

Fix list numbering, image insert, and mobile layout/download - #4

Merged
raj-khan merged 4 commits into
mainfrom
fix/lists-images-mobile
Jun 21, 2026
Merged

raj-khan merged 4 commits into
mainfrom
fix/lists-images-mobile

Conversation

@raj-khan

Copy link
Copy Markdown
Owner

Overview

Fixes five editor bugs reported from desktop and mobile.

Fixes

1. List numbering rendered as roman numerals. The bullet/numbered toolbar buttons blindly prepended a marker, so applying them to already-numbered text produced doubled markers (1. 1.). Markdown parses that as a nested list, which github-markdown-css renders as lower-roman (i, ii, iii). The buttons now strip any existing marker first and renumber cleanly, so you always get a flat 1. 2. 3. (decimal).

2. Images inserted by URL didn't preview. Images render fine once the URL is valid — the problem was the placeholder https://, which users left in place (broken) or appended to. The image/link inserts now use a clear url placeholder, with the URL pre-selected on image insert so a real address replaces it immediately.

3. Mobile "Download failed". The blob object URL was revoked immediately after the click; mobile browsers read the blob asynchronously, so the download failed. Cleanup is now deferred.

4. Mobile: blank area below the editor + no full-height panes. The pane container was block-flow on mobile, so the active pane didn't stretch. It's now a flex column on mobile, so the editor/preview fill the height (no white gap).

5. Mobile: long previews couldn't scroll to the bottom. Same root cause as #4 — with a bounded pane height the preview's internal scroll now reaches the end.

Verification

Browser-tested:

  • Numbered/bullet buttons on already-listed text → no doubling; preview is a flat decimal <ol> (no nested roman).
  • Image insert → ![alt text](url) with url selected.
  • Export still succeeds ("Exported document.pdf").
  • Mobile (390×780): editor bottom meets the footer exactly (no gap), no page scroll; long preview scrolls fully to the bottom.

npm run lint and npm run build pass.

raj-khan added 4 commits June 21, 2026 22:09
Re-applying the list buttons (or applying to already-numbered text) used to
produce doubled markers like "1. 1.", which Markdown renders as a nested
list with roman numerals. The new listLines transform strips any existing
marker first and renumbers cleanly.
Bullet/numbered buttons now normalize markers instead of stacking them.
The image and link inserts use a clear "url" placeholder with the URL
pre-selected, so a real address replaces it instead of leaving a broken
"https://".
Mobile browsers read the blob asynchronously after the click, so revoking
the object URL immediately showed "Download failed". Clean up after a delay
instead.
On mobile the pane container was block-flow, so the active pane didn't
stretch — leaving a large blank area below the editor and preventing long
previews from scrolling to the bottom. Use a flex column on mobile so each
pane fills the available height and scrolls internally.
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
markdowntopdf Ready Ready Preview, Comment Jun 21, 2026 2:10pm

@raj-khan
raj-khan merged commit d17d46f into main Jun 21, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 65f6ac2b Deployed Jun 21, 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.

1 participant