From 47ed137be382dab3a34a8efe89ab446229216b1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 17:20:22 +0000 Subject: [PATCH 1/5] Add modal UI for link, reference, and image tools Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/b2788a61-05c8-4f0f-a5d0-8ecd315db97a Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com> --- desktop-app/resources/index.html | 78 +++++++- desktop-app/resources/js/script.js | 293 +++++++++++++++++++++++++++-- desktop-app/resources/styles.css | 41 ++++ index.html | 78 +++++++- script.js | 293 +++++++++++++++++++++++++++-- styles.css | 41 ++++ 6 files changed, 786 insertions(+), 38 deletions(-) diff --git a/desktop-app/resources/index.html b/desktop-app/resources/index.html index bc95d13..9ee192c 100644 --- a/desktop-app/resources/index.html +++ b/desktop-app/resources/index.html @@ -287,7 +287,7 @@
Menu
- + @@ -332,6 +332,82 @@
Menu
+ + + + + + + + + + + + + + + + + +
- +
diff --git a/desktop-app/resources/js/script.js b/desktop-app/resources/js/script.js index 719843d..11cfdd8 100644 --- a/desktop-app/resources/js/script.js +++ b/desktop-app/resources/js/script.js @@ -1853,7 +1853,7 @@ This is a fully client-side application. Your content never leaves your browser function getUsedReferenceNumbers(text) { const used = new Set(); - const regex = /\[(\d+)\]/g; + const regex = /^\[(\d+)\]:/gm; let match = regex.exec(text); while (match) { const num = parseInt(match[1], 10); @@ -1871,10 +1871,6 @@ This is a fully client-side application. Your content never leaves your browser function sanitizeMarkdownTitle(title) { return title - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/'/g, ''') .replace(/\\/g, '\\\\') .replace(/"/g, '\\"'); } @@ -1969,8 +1965,8 @@ This is a fully client-side application. Your content never leaves your browser modal.style.display = 'flex'; function buildImageMarkdown(url) { - const altText = altInput.value.trim() || 'alt text'; const titleText = altInput.value.trim(); + const altText = titleText || 'alt text'; const safeTitle = sanitizeMarkdownTitle(titleText); const titlePart = safeTitle ? ' "' + safeTitle + '"' : ''; return '![' + altText + '](' + url + titlePart + ')'; diff --git a/index.html b/index.html index 8ed49af..04dd4e3 100644 --- a/index.html +++ b/index.html @@ -338,7 +338,7 @@
Menu
- +
@@ -395,7 +395,7 @@
Menu
- +
diff --git a/script.js b/script.js index 719843d..11cfdd8 100644 --- a/script.js +++ b/script.js @@ -1853,7 +1853,7 @@ This is a fully client-side application. Your content never leaves your browser function getUsedReferenceNumbers(text) { const used = new Set(); - const regex = /\[(\d+)\]/g; + const regex = /^\[(\d+)\]:/gm; let match = regex.exec(text); while (match) { const num = parseInt(match[1], 10); @@ -1871,10 +1871,6 @@ This is a fully client-side application. Your content never leaves your browser function sanitizeMarkdownTitle(title) { return title - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/'/g, ''') .replace(/\\/g, '\\\\') .replace(/"/g, '\\"'); } @@ -1969,8 +1965,8 @@ This is a fully client-side application. Your content never leaves your browser modal.style.display = 'flex'; function buildImageMarkdown(url) { - const altText = altInput.value.trim() || 'alt text'; const titleText = altInput.value.trim(); + const altText = titleText || 'alt text'; const safeTitle = sanitizeMarkdownTitle(titleText); const titlePart = safeTitle ? ' "' + safeTitle + '"' : ''; return '![' + altText + '](' + url + titlePart + ')'; From 6d03e43c94951fd3edd18dc7f1e152fce61f9c9f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 17:49:19 +0000 Subject: [PATCH 4/5] Refine reference previews and image uploads Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/0b1640e1-7932-428f-8aa1-ded4211f4d36 Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com> --- desktop-app/resources/index.html | 8 +++---- desktop-app/resources/js/script.js | 35 +++++++++++++++++++++--------- desktop-app/resources/styles.css | 10 +++++++++ index.html | 8 +++---- script.js | 35 +++++++++++++++++++++--------- styles.css | 10 +++++++++ 6 files changed, 78 insertions(+), 28 deletions(-) diff --git a/desktop-app/resources/index.html b/desktop-app/resources/index.html index f70b07e..b9be4d0 100644 --- a/desktop-app/resources/index.html +++ b/desktop-app/resources/index.html @@ -287,7 +287,7 @@
Menu
- + @@ -311,7 +311,7 @@
Menu