Repository navigation
Fix list numbering, image insert, and mobile layout/download - #4
Merged
Merged
Conversation
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.
|
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.
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 flat1. 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 clearurlplaceholder, 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:
<ol>(no nested roman).withurlselected.npm run lintandnpm run buildpass.