Summary
SnapDock currently handles link navigation incorrectly due to default Electron behaviors.
This affects both external URLs and local file links inside the Markdown preview.
This issue is not related to markdown-it-link-attributes wiring (verified working).
The problem exists in SnapDock’s navigation policy, split between the main process and renderer.
Problems Identified
1. External links open in a new SnapDock Electron window
Example:
Expected:
- Open in the system browser
Actual:
- Electron opens a new BrowserWindow
- Window loads SnapDock’s HTML (logo)
- User sees a blank SnapDock window instead of the website
Cause:
Electron intercepts target="_blank" and creates a new BrowserWindow unless overridden.
2. Local file links open a blank SnapDock window
Example:
./README.md
./src/modules/markdown.js
Expected:
- Open the file in a new SnapDock tab
- Load file content into the editor
Actual:
- Electron opens a new BrowserWindow
- Window is blank
- No file is loaded
Cause:
Electron treats relative paths as navigation requests and opens a new window.
3. Attribute blocks render literally (expected)
Example:
[Google](https://google.com){target="_blank"}
This is correct behavior — SnapDock does not support attribute block syntax.
Goal
Implement a proper link‑navigation policy so SnapDock behaves like a modern editor:
- External links → open in system browser
- Internal file links → open file in a new tab
- No new Electron windows created by link clicks
- Markdown preview remains sandboxed and safe
Deliverables
A. Main Process Fix (External Links)
Add navigation interception:
- Intercept
new-window
- Intercept
will-navigate
- Detect external URLs
- Redirect using
shell.openExternal(url)
- Prevent Electron from creating new windows
B. Renderer Fix (Internal Links)
Add click handler for <a> tags:
- Detect relative paths
- Prevent default navigation
- IPC → open file in new tab
- Ensure editor loads file content correctly
C. No changes to markdown-it
Link attributes are already wired and functioning.
Testing Requirements
Use the Markdown test file to verify:
- External links open system browser
- Internal links open new SnapDock tabs
- No blank windows
- No navigation errors
- No regressions in markdown rendering
Closing Condition
This issue is complete when:
- External URLs never open inside Electron
- Internal file links always open in a new tab
- No new BrowserWindows are created from link clicks
- Behavior matches expected UX for SnapDock v3.2.x
Summary
SnapDock currently handles link navigation incorrectly due to default Electron behaviors.
This affects both external URLs and local file links inside the Markdown preview.
This issue is not related to markdown-it-link-attributes wiring (verified working).
The problem exists in SnapDock’s navigation policy, split between the main process and renderer.
Problems Identified
1. External links open in a new SnapDock Electron window
Example:
Expected:
Actual:
Cause:
Electron intercepts
target="_blank"and creates a new BrowserWindow unless overridden.2. Local file links open a blank SnapDock window
Example:
Expected:
Actual:
Cause:
Electron treats relative paths as navigation requests and opens a new window.
3. Attribute blocks render literally (expected)
Example:
This is correct behavior — SnapDock does not support attribute block syntax.
Goal
Implement a proper link‑navigation policy so SnapDock behaves like a modern editor:
Deliverables
A. Main Process Fix (External Links)
Add navigation interception:
new-windowwill-navigateshell.openExternal(url)B. Renderer Fix (Internal Links)
Add click handler for
<a>tags:C. No changes to markdown-it
Link attributes are already wired and functioning.
Testing Requirements
Use the Markdown test file to verify:
Closing Condition
This issue is complete when: