Render multi‑paragraph footnotes inline and restore nested list indentation#102
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/ba5d080a-a4d8-4241-92af-5f5f6138151d Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/ba5d080a-a4d8-4241-92af-5f5f6138151d Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ThisIs-Developer
May 16, 2026 04:54
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/6b8ce336-b6dc-4563-af82-e4353ea44c7f Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Deploying markdown-viewer with
|
| Latest commit: |
45226b1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://997e2e67.markdown-viewer.pages.dev |
| Branch Preview URL: | https://copilot-fix-footnote-display.markdown-viewer.pages.dev |
Deploying markdownviewer with
|
| Latest commit: |
45226b1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://74556fa5.markdownviewer.pages.dev |
| Branch Preview URL: | https://copilot-fix-footnote-display.markdownviewer.pages.dev |
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/6b8ce336-b6dc-4563-af82-e4353ea44c7f Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/6b8ce336-b6dc-4563-af82-e4353ea44c7f Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/6b8ce336-b6dc-4563-af82-e4353ea44c7f Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/6b8ce336-b6dc-4563-af82-e4353ea44c7f Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/1cdf3acf-6eb8-477b-9f3b-e37c09c496fa Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Markdown viewer’s rendering to better match common GitHub-style output by (1) restoring consistent list indentation (including nested lists/task lists) and (2) improving footnote definition parsing/rendering so multi-paragraph footnotes render cleanly with an inline back-reference. It also synchronizes the desktop app’s HTML toolbar/menu with the web version.
Changes:
- Adjust list CSS to restore consistent padding/margins for
ul/ol(including task lists). - Update footnote parsing to capture indented multiline footnote bodies and render the backref inline with the last paragraph (web + desktop).
- Sync
desktop-app/resources/index.htmlwith the web UI for RTL/LTR direction toggle controls.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
styles.css |
Restores list indentation and spacing rules (incl. task lists). |
script.js |
Updates footnote parsing and renders multi-paragraph footnotes with inline backref. |
desktop-app/resources/styles.css |
Mirrors list indentation/spacing changes for the desktop bundle. |
desktop-app/resources/js/script.js |
Mirrors footnote parsing/rendering changes for the desktop bundle. |
desktop-app/resources/index.html |
Adds the direction toggle buttons to match the web UI layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+353
to
+385
| const match = /^([ \t]{0,3})\[\^([^\]\n]+)\]:[ \t]*(.*)$/.exec(lines[index]); | ||
| if (!match) { | ||
| preservedLines.push(lines[index]); | ||
| index += 1; | ||
| continue; | ||
| } | ||
|
|
||
| const id = match[1].trim(); | ||
| const definitionLines = [match[2] || ""]; | ||
| const baseIndent = match[1] || ""; | ||
| const id = match[2].trim(); | ||
| const definitionLines = [match[3] || ""]; | ||
| index += 1; | ||
|
|
||
| while (index < lines.length) { | ||
| const line = lines[index]; | ||
| const indentedMatch = /^(?: {4}|\t)(.*)$/.exec(line); | ||
| if (!line.startsWith(baseIndent)) { | ||
| break; | ||
| } | ||
|
|
||
| const lineAfterBase = line.slice(baseIndent.length); | ||
| const indentedMatch = /^(?: {2,}|\t)(.*)$/.exec(lineAfterBase); | ||
| if (indentedMatch) { | ||
| definitionLines.push(indentedMatch[1]); | ||
| index += 1; | ||
| continue; | ||
| } | ||
|
|
||
| if (line === "" && /^(?: {4}|\t)/.test(lines[index + 1] || "")) { | ||
| definitionLines.push(""); | ||
| index += 1; | ||
| continue; | ||
| if (lineAfterBase.trim() === "") { | ||
| const nextLine = lines[index + 1] || ""; | ||
| const nextAfterBase = nextLine.startsWith(baseIndent) | ||
| ? nextLine.slice(baseIndent.length) | ||
| : ""; | ||
| if (/^(?: {2,}|\t)/.test(nextAfterBase)) { | ||
| definitionLines.push(""); |
Comment on lines
+353
to
+385
| const match = /^([ \t]{0,3})\[\^([^\]\n]+)\]:[ \t]*(.*)$/.exec(lines[index]); | ||
| if (!match) { | ||
| preservedLines.push(lines[index]); | ||
| index += 1; | ||
| continue; | ||
| } | ||
|
|
||
| const id = match[1].trim(); | ||
| const definitionLines = [match[2] || ""]; | ||
| const baseIndent = match[1] || ""; | ||
| const id = match[2].trim(); | ||
| const definitionLines = [match[3] || ""]; | ||
| index += 1; | ||
|
|
||
| while (index < lines.length) { | ||
| const line = lines[index]; | ||
| const indentedMatch = /^(?: {4}|\t)(.*)$/.exec(line); | ||
| if (!line.startsWith(baseIndent)) { | ||
| break; | ||
| } | ||
|
|
||
| const lineAfterBase = line.slice(baseIndent.length); | ||
| const indentedMatch = /^(?: {2,}|\t)(.*)$/.exec(lineAfterBase); | ||
| if (indentedMatch) { | ||
| definitionLines.push(indentedMatch[1]); | ||
| index += 1; | ||
| continue; | ||
| } | ||
|
|
||
| if (line === "" && /^(?: {4}|\t)/.test(lines[index + 1] || "")) { | ||
| definitionLines.push(""); | ||
| index += 1; | ||
| continue; | ||
| if (lineAfterBase.trim() === "") { | ||
| const nextLine = lines[index + 1] || ""; | ||
| const nextAfterBase = nextLine.startsWith(baseIndent) | ||
| ? nextLine.slice(baseIndent.length) | ||
| : ""; | ||
| if (/^(?: {2,}|\t)/.test(nextAfterBase)) { | ||
| definitionLines.push(""); |
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.
Uh oh!
There was an error while loading. Please reload this page.