Skip to content

Render multi‑paragraph footnotes inline and restore nested list indentation#102

Merged
ThisIs-Developer merged 8 commits into
mainfrom
copilot/fix-footnote-display-issues
May 17, 2026
Merged

Render multi‑paragraph footnotes inline and restore nested list indentation#102
ThisIs-Developer merged 8 commits into
mainfrom
copilot/fix-footnote-display-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

  • Run existing build/tests to capture baseline state
  • Broaden footnote continuation parsing to keep indented multiline bodies (web + desktop)
  • Re-run existing build/tests
  • Run parallel validation

Copilot AI and others added 2 commits May 16, 2026 04:50
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

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

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment May 17, 2026 4:57pm

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>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 17, 2026

Deploying markdown-viewer with  Cloudflare Pages  Cloudflare Pages

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

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 17, 2026

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 45226b1
Status: ✅  Deploy successful!
Preview URL: https://74556fa5.markdownviewer.pages.dev
Branch Preview URL: https://copilot-fix-footnote-display.markdownviewer.pages.dev

View logs

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>
@ThisIs-Developer ThisIs-Developer marked this pull request as ready for review May 17, 2026 17:01
Copilot AI review requested due to automatic review settings May 17, 2026 17:01
@ThisIs-Developer ThisIs-Developer merged commit 14bb11d into main May 17, 2026
5 checks passed
@ThisIs-Developer ThisIs-Developer deleted the copilot/fix-footnote-display-issues branch May 17, 2026 17:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.html with 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 thread script.js
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("");
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.

3 participants