Repository navigation
Data safety fixes - #1
Merged
Merged
Conversation
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  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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.