Repository navigation
Description
Search first
- Searched open/closed db-test reports and related Logseq PRs
What happened?
An inline Markdown image using a valid file:/// URL with %20 for spaces shows a broken image. The same PNG renders when the spaces are literal, both as an absolute path and as a file URL.
This is present on current master including merged logseq/logseq#13552. I have not compared the preceding revision, so this is not a claim that the PR introduced the problem.
Reproduce
- Use a disposable local DB graph in Electron. Put a valid PNG in a directory and filename containing spaces. The exact tested file was:
/workspace/shared/logseq-qa/fixtures/path spaces/qa image.png
(180 × 180 PNG, 5,107 bytes; any local PNG can be used with the path adjusted.) - Create a normal page and type this into a new ordinary block:

- Press Escape to save and leave editing. The block displays a broken image / fallback label.
- Add these two blocks pointing to the same file:
 
- Both literal-space controls render the image.
- Reload with Ctrl+R, navigate away/back, and reopen the page after an Electron relaunch. The encoded URL remains broken; both controls still render.
Expected
Percent-encoded spaces in a file URL resolve to the same existing local file as the literal-space controls, rather than becoming literal percent characters in the filename.
Actual / frequency
- 2/2 independently entered encoded-URL blocks on two newly created pages failed in the same disposable graph
- The first fixture also remained broken after reload and a full Electron relaunch/rebuild at the same SHA
- Both literal-space controls rendered, including after reload/relaunch
- A separate absolute-path PNG without spaces rendered
- File contents remained unchanged; no data-loss claim
Supporting runtime evidence
A read-only renderer inspection after the UI reproduction at 2026-10-01 14:35:48 UTC showed:
| Input | DOM src attribute | natural size |
|---|---|---|
| encoded file URL | assets:///workspace/shared/logseq-qa/fixtures/path%2520spaces/qa%2520image.png |
0 × 0 |
| literal-space absolute path | assets:///workspace/shared/logseq-qa/fixtures/path%20spaces/qa%20image.png |
180 × 180 |
| literal-space file URL | same single-encoded %20 URL |
180 × 180 |
All images had complete=true. The exact file's SHA-256 is 0ac46d1e0bc2a0ff3d791c9f3ddcd3b084e27a6e26dd57fbb182cfbbf8c4225f.
Likely source path, not a tested fix: mldoc preserves %20 in the file link; string-of-url returns its path without the file scheme; file-path->assets-url then treats the already escaped path as a native path and encodes % again. The actual rendered %2520 above supports this explanation.
Related reports checked
- db-test#1231 / open logseq/logseq#13321: Chromium-rewritten assets URL / missing-slash warning. That warning also occurs for the passing controls here; it is not the failure criterion for this report
- db-test#665: relative asset references, different input
- db-test#482: historical Windows drive file-link handling
- Merged #13552's local-image work and reviews checked; no exact percent-double-encoding case found
Platform
- Debian GNU/Linux 13, x86_64
- Logseq DB 2.0.1, development Electron app
- Exact master SHA:
8ffbb220938acc00e1c70e8579e7c52ab97c2aa7 - Live renderer and Node worker both verified
8ffbb22; retest build 2026-10-01T14:32:34Z - Electron 42.3.0 / Chromium 148.0.7778.180
- Disposable local DB graph, no authenticated sync
- Web app untested: this environment's cloud-browser route to the local dev server was blocked by the client
Activity
fix: decode percent-encoded local image paths once
fix: decode percent-encoded local image paths once
yuxi-liu-wired commentedon Oct 28, 2026
Fixed in logseq/logseq#13897 (fix: file:// image paths, #alias of a tag, Validate graph report, PDF viewer after reload). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
1 remaining item
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix: decode percent-encoded local image paths once
fix: decode percent-encoded local image paths once
fix: decode percent-encoded local image paths once (logseq#13563)
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(assets): decode percent-encoded file:// image paths before buildi…
fix(ui): align LUI desktop web UX with master (#14071)