Skip to content

Data safety fixes - #1

Merged
RAZKOM merged 7 commits into
mainfrom
data-safety-fixes
Nov 3, 2026
Merged

RAZKOM merged 7 commits into
mainfrom
data-safety-fixes

Conversation

@RAZKOM

@RAZKOM RAZKOM commented Nov 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

The editor works in "\n" only, so saving a file with CRLF endings used to
rewrite every line as LF, and res.text() dropped a UTF-8 byte-order mark.
The page now remembers how the file was written and puts both back on
save. A file that isn't valid UTF-8 can still be viewed and edited, but
saving it is refused so the undecodable bytes aren't replaced.
Saving wrote the file in place, so a crash or a full disk partway through
could leave it truncated. Documents, settings and the window size are now
written to a temporary file next to the original and renamed over it.
Symlinks are written through, permissions are kept, read-only files are
still refused, and where a rename isn't possible (a file with other hard
links, or one Windows won't replace) it falls back to the old in-place
write.
Relative links and images went through the same resolver, which refused
any path with ".." in it. So [guide](../README.md) did nothing when
clicked, and ![](../images/x.png) never loaded from a docs/ folder.

Links are now resolved anywhere relative to the document, since they only
open on a click: Markdown opens a new window, folders and safe file types
(PDF, images, text, CSV, models) open in their default app, and anything
else is shown in the file manager instead of being run.

Images and models may come from anywhere in the document's git
repository, but never from .git, and not when the repository is the home
folder itself. Outside a repository they stay limited to the document's
folder. Leading ../ segments travel as /up/<n>/<path>, because the
browser would otherwise fold them out of the URL.
On Windows every double-clicked file starts its own process, so a theme,
width or text size change only reached windows in the process that made
it, and `mdown theme` only affected new windows. Each viewer process now
watches settings.json and applies it whenever it changes.
Actions > Release > Run workflow on main now releases the version in
Cargo.toml: the check refuses other branches and versions that already
have a tag, and the final step creates the tag together with the GitHub
release. Pushing a tag works as before.
@RAZKOM
RAZKOM merged commit 8a16b50 into main Nov 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant