From a8b5f07fc2c16d5db67fd2dfd8b3da051f8fdb6e Mon Sep 17 00:00:00 2001 From: Alec Ames Date: Fri, 27 Mar 2026 02:04:22 -0400 Subject: [PATCH 1/9] chore: feature test document update --- samples/test-features.md | 46 +++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/samples/test-features.md b/samples/test-features.md index 730fadb..0946ba0 100644 --- a/samples/test-features.md +++ b/samples/test-features.md @@ -16,9 +16,24 @@ Jumps to location in document --- +# Callouts + +> [!note] Custom titled callout +> This is a note callout + +> [!tip] Tip: combine ==highlights== with **bold** for emphasis. + +> [!IMPORTANT] Nested callouts work too +> > [!note] Nested callout +> > This is a nested callout +> > > [!info] Nested callout +> > > This is a nested callout + +--- + # Highlights -You can ==highlight text== inline just like in Obsidian. +You can ==highlight text== inline. Multiple ==highlights== can appear ==in the same== paragraph. @@ -50,7 +65,7 @@ Long note name with alias — this demonstrates that the block ID is separate fr A third paragraph with its own anchor you can reference from the TOC. ^third-anchor -Obsidian-style internal links: [[#important]] jumps to the first paragraph above. +Internal links: [[#important]] jumps to the first paragraph above. --- @@ -103,25 +118,6 @@ And level 5. --- -## GFM Alerts - -> [!NOTE] -> This is a note alert — check if the icon and color are correct. - -> [!TIP] -> Tip: combine ==highlights== with**bold** for emphasis. - -> [!IMPORTANT] -> Block IDs ^block-in-quote are supported inside blockquotes too. - -> [!WARNING] -> Task toggles auto-save to disk — make sure you have write access. - -> [!CAUTION] -> Unchecking a task rewrites the raw markdown file immediately. - ---- - ## Code Blocks Inline code: `let x = 42;` — `==no highlight here==` @@ -160,7 +156,7 @@ fn process_highlights(content: &str) -> String { | Standard footnotes | `[^ref]` | ✅ | | Block IDs | `^id` | ✅ | | Task toggle | `- [ ]` click | ✅ | -| Obsidian links | `[[#heading]]` | ✅ | +| Wikilinks | `[[#heading]]` | ✅ | --- @@ -176,7 +172,8 @@ Superscript: x^2 (not supported inline) vs actual footnote^[this is a footnote]. A regular link: [GitHub](https://github.com) -An image: ![Test](https://via.placeholder.com/400x200?text=Test+Image) +An image: +![Test](https://picsum.photos/400/200) --- @@ -227,6 +224,3 @@ graph TD B -->|No| D[Debug it] D --> B ``` - ---- - From 7e82b8cc4392cf9eafa0196ad6faf2d673c79c66 Mon Sep 17 00:00:00 2001 From: Alec Ames Date: Fri, 27 Mar 2026 02:06:40 -0400 Subject: [PATCH 2/9] feature: zoom overlay with pan and zoom --- src/lib/MarkdownViewer.svelte | 31 ++++- src/lib/components/ZoomOverlay.svelte | 162 ++++++++++++++++++++++++++ 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 src/lib/components/ZoomOverlay.svelte diff --git a/src/lib/MarkdownViewer.svelte b/src/lib/MarkdownViewer.svelte index 11c93e2..bd09d86 100644 --- a/src/lib/MarkdownViewer.svelte +++ b/src/lib/MarkdownViewer.svelte @@ -16,6 +16,9 @@ import Toc from './components/Toc.svelte'; import { slide } from 'svelte/transition'; import Toast from './components/Toast.svelte'; + import { exportAsHtml as _exportHtml, exportAsPdf } from './utils/export'; + import ZoomOverlay from './components/ZoomOverlay.svelte'; +import { processMarkdownHtml } from './utils/markdown'; const appWindow = getCurrentWindow(); @@ -81,6 +84,8 @@ // in-page scroll position history for mouse 4/5 nav let scrollHistory: number[] = []; let scrollFuture: number[] = []; + let collapsedHeaders = $state(new Set()); + let zoomData = $state<{ src?: string; html?: string } | null>(null); // derived from tab manager let activeTab = $derived(tabManager.activeTab); @@ -920,7 +925,23 @@ } } } - } + + // media zoom handling + const img = target.closest('img'); + if (img) { + zoomData = { src: img.src }; + return; + } + + const mermaidDiv = target.closest('.mermaid-diagram'); + if (mermaidDiv) { + const svg = mermaidDiv.querySelector('svg'); + if (svg) { + zoomData = { html: svg.outerHTML }; + return; + } + } + } async function toggleTaskCheckbox(checkbox: HTMLInputElement) { const tab = tabManager.activeTab; @@ -2129,6 +2150,14 @@ ${markdownBody?.innerHTML || htmlContent} {/each} + {#if zoomData} + zoomData = null} + /> + {/if} + {#if isDragging}