René's URL Explorer Experiment


Title: id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw · Issue #1307 · developing-today/code · GitHub

Open Graph Title: id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw · Issue #1307 · developing-today/code

X Title: id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw · Issue #1307 · developing-today/code

Description: id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw Summary Opening a plain-text (.txt) file in id and saving it — even with no edits — rewrites the file: the final...

Open Graph Description: id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw Summary Opening a plain-text (.txt) file in id and saving it — even with...

X Description: id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw Summary Opening a plain-text (.txt) file in id and saving it — even with...

Opengraph URL: https://github.com/developing-today/code/issues/1307

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw","articleBody":"# id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw\n\n## Summary\n\nOpening a plain-text (`.txt`) file in id and saving it — even with no\nedits — rewrites the file: the final newline is always removed, and\nCRLF line endings are converted to LF. Raw mode round-trips\nbyte-exactly; Plain mode does not.\n\n## Evidence\n\n- Load: `pkgs/id/src/web/markdown.rs:1825` `plain_text_to_prosemirror`\n  splits with `str::lines()`, which yields no element for a single\n  trailing newline and strips the `\\r` of CRLF endings.\n- Save: `pkgs/id/src/web/routes.rs:2009` `extract_plain_text` joins\n  paragraphs with `\"\\n\"` and appends nothing at the end — so the\n  trailing newline the load discarded can never come back.\n- Verified this run on origin/main 90f7ea00 with a probe crate running\n  the real load function plus the verbatim save function (log:\n  `hidden_files/probe-2026-10-26-2352/out3.log`):\n  - `\"alpha\\nbeta\\n\"` → `\"alpha\\nbeta\"` (final newline lost)\n  - `\"alpha\\n\"` → `\"alpha\"`; `\"\\n\"` → `\"\"`; `\"alpha\\n\\n\"` → `\"alpha\\n\"`\n  - `\"alpha\\r\\nbeta\\r\\n\"` → `\"alpha\\nbeta\"` (CRLF rewritten to LF)\n  - Controls that round-trip exactly: `\"alpha\\nbeta\"` (no trailing\n    newline) and `\"\"`.\n- Contrast: Raw mode (`raw_text_to_prosemirror` /\n  `extract_raw_text`) keeps the whole file in one code block and\n  round-trips byte-exactly, including the trailing newline.\n\n## Why it matters\n\nEvery POSIX text file ends in a newline; a no-op open→save in id\nproduces a spurious diff (`\\ No newline at end of file`), breaks\ntools that require a terminating newline, and silently converts\nCRLF files (common for notes shared with Windows editors) to LF.\nFidelity loss in the mode whose entire job is plain bytes.\n\n## Acceptance criteria\n\n- A documented, tested policy makes no-edit open→save of a `.txt`\n  file byte-stable for the common shapes: trailing newline present\n  or absent, and CRLF endings (either preserved, or — if LF\n  normalization is the deliberate choice — called out in the mode's\n  docs and pinned by a test, not accidental).\n- Regression tests cover at least: `\"a\\nb\\n\"`, `\"a\\nb\"`, `\"a\\n\"`,\n  `\"\"`, and a CRLF sample, through the real load→save pair.\n- Markdown and Raw save/load behavior unchanged.\n\n## Notes\n\nThe information loss happens at load (`lines()` cannot distinguish\n`\"a\"` from `\"a\\n\"`), so a fix likely needs the load side to carry the\ntrailing-newline fact (e.g. a trailing empty paragraph, mirroring how\n`\"a\\n\\n\"` already loads) or the save side to adopt an\nalways-terminate policy — triage should pick and pin one.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-27T05:34:14Z","url":"https://github.com/developing-today/code/issues/1307"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:da28cbc7-49c5-2ace-21ca-3d0bef842673
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id94FA:5F360:91C132:BCB008:6B062F95
html-safe-noncee9e5216676c8f18ceef58b0f8f64f3ce6ed7d85dc1aa5ef815067b0987af74ea
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEZBOjVGMzYwOjkxQzEzMjpCQ0IwMDg6NkIwNjJGOTUiLCJ2aXNpdG9yX2lkIjoiNzcwNzc3MjA5MjQzMTA4NTQ2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac85052c4195fbc4e5e327145f59d64e7fabaec1aca74c6c57686543ce0fd74a81
hovercard-subject-tagissue:6053541772
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1307/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3c7f90cd9900ca962a7797304b4260f2eb415e5d6be601e239637c15c6ef064e/developing-today/code/issues/1307
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3c7f90cd9900ca962a7797304b4260f2eb415e5d6be601e239637c15c6ef064e/developing-today/code/issues/1307
og:image:altid(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw Summary Opening a plain-text (.txt) file in id and saving it — even with...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedezren39
hostnamegithub.com
expected-hostnamegithub.com
None7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3
turbo-cache-controlno-preview
go-importgithub.com/developing-today/code git https://github.com/developing-today/code.git
octolytics-dimension-user_id26439447
octolytics-dimension-user_logindeveloping-today
octolytics-dimension-repository_id627308783
octolytics-dimension-repository_nwodeveloping-today/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627308783
octolytics-dimension-repository_network_root_nwodeveloping-today/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release494ea0bb1e0feef734a83e2628697647755e8864
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/developing-today/code/issues/1307#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F1307
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F1307
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode
Reloadhttps://github.com/developing-today/code/issues/1307
Reloadhttps://github.com/developing-today/code/issues/1307
Reloadhttps://github.com/developing-today/code/issues/1307
developing-todayhttps://github.com/developing-today
codehttps://github.com/developing-today/code
Codehttps://github.com/developing-today/code
Issues1.1k (1.1k)https://github.com/developing-today/code/issues
Pull requests151 (151)https://github.com/developing-today/code/pulls
Discussionshttps://github.com/developing-today/code/discussions
Actionshttps://github.com/developing-today/code/actions
Projectshttps://github.com/developing-today/code/projects
Wikihttps://github.com/developing-today/code/wiki
Security and qualityhttps://github.com/developing-today/code/security
Insightshttps://github.com/developing-today/code/insights
https://github.com/developing-today/code
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/1307
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/1307
#4613https://github.com/developing-today/code/pull/4613
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Rawhttps://github.com/developing-today/code/issues/1307#top
#4613https://github.com/developing-today/code/pull/4613
https://github.com/dezren39
app/idhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fid%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/lowhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Flow%22
source/creatorhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 27, 2026https://github.com/developing-today/code/issues/1307#issue-6053541772
90f7ea0https://github.com/developing-today/code/commit/90f7ea00817af04b083560941c08a8fdd546914b
Nexthttps://github.com/developing-today/code/issues/1307?timeline_page=1
https://github.com/apps/developing-today
developing-todayhttps://github.com/apps/developing-today
on Oct 27, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6434621455
developing.todayhttps://kaneo.security.cab
CODE-425https://kaneo.security.cab/dashboard/workspace/6oQgIkST0YGrCcxrnhbHPOUCfgdD3cqE/project/pfcq432h349r20up18gttfv4/task/sz2b662x1zn3pgvmoamrsfn0
github-actionshttps://github.com/apps/github-actions
dezren39https://github.com/dezren39
on Oct 27, 2026https://github.com/developing-today/code/issues/1307#event-34334004459
dezren39https://github.com/dezren39
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
source/creatorhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
priority/lowhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Flow%22
app/idhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fid%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
on Oct 27, 2026https://github.com/developing-today/code/issues/1307#event-34334041329
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 27, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6434777745
90f7ea0https://github.com/developing-today/code/commit/90f7ea00817af04b083560941c08a8fdd546914b
dezren39https://github.com/dezren39
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
on Nov 2, 2026https://github.com/developing-today/code/issues/1307#event-34959597348
dezren39https://github.com/dezren39
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
on Nov 2, 2026https://github.com/developing-today/code/issues/1307#event-34963328066
dezren39https://github.com/dezren39
on Nov 2, 2026https://github.com/developing-today/code/issues/1307#event-34965327844
fix(id/web): preserve a lone trailing CR in plain mode — only newline…https://github.com/developing-today/code/commit/25489497e6a860f2b49befd24fff81ffb92f8343
2548949https://github.com/developing-today/code/commit/25489497e6a860f2b49befd24fff81ffb92f8343
dezren39https://github.com/dezren39
completedhttps://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#4613https://github.com/developing-today/code/pull/4613
on Nov 2, 2026https://github.com/developing-today/code/issues/1307#event-34965381188
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 2, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6590965337
#4613https://github.com/developing-today/code/pull/4613
#1307https://github.com/developing-today/code/issues/1307
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307https://github.com/developing-today/code/issues/1307
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
2548949https://github.com/developing-today/code/commit/25489497e6a860f2b49befd24fff81ffb92f8343
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
1155872https://github.com/developing-today/code/commit/1155872fe63e1423e24a3003b551e2bfb4e87c60
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307https://github.com/developing-today/code/issues/1307
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
dezren39https://github.com/dezren39
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Nov 2, 2026https://github.com/developing-today/code/issues/1307#event-34965418295
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 8, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6718345780
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307https://github.com/developing-today/code/issues/1307
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
1155872https://github.com/developing-today/code/commit/1155872fe63e1423e24a3003b551e2bfb4e87c60
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307https://github.com/developing-today/code/issues/1307
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
2548949https://github.com/developing-today/code/commit/25489497e6a860f2b49befd24fff81ffb92f8343
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613https://github.com/developing-today/code/pull/4613
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307https://github.com/developing-today/code/issues/1307
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 8, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6718347634
dezren39https://github.com/dezren39
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Nov 8, 2026https://github.com/developing-today/code/issues/1307#event-35479952123
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 8, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6718349111
https://github.com/dezren39
dezren39https://github.com/dezren39
on Nov 8, 2026https://github.com/developing-today/code/issues/1307#issuecomment-6718349351
#4613https://github.com/developing-today/code/pull/4613
1155872https://github.com/developing-today/code/commit/1155872fe63e1423e24a3003b551e2bfb4e87c60
#1307https://github.com/developing-today/code/issues/1307
2548949https://github.com/developing-today/code/commit/25489497e6a860f2b49befd24fff81ffb92f8343
#1307https://github.com/developing-today/code/issues/1307
dezren39https://github.com/dezren39
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Nov 8, 2026https://github.com/developing-today/code/issues/1307#event-35479957371
Sign up for freehttps://github.com/signup?return_to=https://github.com/developing-today/code/issues/1307
Sign in to commenthttps://github.com/login?return_to=https://github.com/developing-today/code/issues/1307
dezren39https://github.com/dezren39
app/idhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fid%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/lowhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Flow%22
source/creatorhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.