feat(viewer): Markdown and plain-text documents are drawn as text
check / check (push) Canceled after 0s

A text/markdown file (or text/x-markdown) is drawn as formatted text by
egui_commonmark, with no image loading, so a document never makes the
viewer read a file or the network; any other text/* type as its
selectable text. UTF-8 only (a leading byte-order mark dropped), at most
2 MiB; past that or not UTF-8, the viewer says why. The documents page's
tile shows the text's first lines. The SHA-256 row is cut to its column
(it ran off the panel and widened the page under it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-10-23 09:05:32 -06:00
1 parent d64e0e9cdf
commit 7cc08a0039
6 files changed
+263 -7

No files matched your search

Generated
+35
View File
@@ -1826,6 +1826,29 @@ dependencies = [
"winit",
]
[[package]]
name = "egui_commonmark"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19e757b2a0639f5f75793e6936ad4c86e8b58ee379d23578ad6924ba9f75ec38"
dependencies = [
"egui",
"egui_commonmark_backend",
"egui_extras",
"pulldown-cmark",
]
[[package]]
name = "egui_commonmark_backend"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67e182e6b923b0ade1152f67e7d827cbc266fca7782d50249de0c4cad1a2a4e5"
dependencies = [
"egui",
"egui_extras",
"pulldown-cmark",
]
[[package]]
name = "egui_extras"
version = "0.36.2"
@@ -3887,6 +3910,7 @@ dependencies = [
"eframe",
"egui",
"egui-phosphor",
"egui_commonmark",
"egui_extras",
"egui_kittest",
"hayro 0.8.0",
@@ -5423,6 +5447,17 @@ dependencies = [
"cc",
]
[[package]]
name = "pulldown-cmark"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "278e9268c93b9e498a2da46c34d90ba93a3255eb99009646398f34bc73ab36eb"
dependencies = [
"bitflags 2.13.2",
"memchr",
"unicase",
]
[[package]]
name = "pxfm"
version = "0.1.30"