You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(container): honor --spaces for legible-text containers (flagless crc-probe)
--spaces was silently ignored in -C/--container mode. Now literal spaces are
kept in the .pbf.json `data` value so text (e.g. Markdown) reads naturally
inside valid single-line JSON (letters/digits/. @ ^ _ already pass through;
newlines stay ¶ glyphs). No schema flag and version stays 1: the crc32_encoded
oracle disambiguates spaces-as-data from transport noise via a keep-then-strip
probe. An ambiguity warning fires when literal spaces coexist with the space
glyph (formatting injected into a non-spaces container); the glyph is read from
the map, not hardcoded. --tabs/--crlf/-w/--preserve + -C now hard-error.
Applied across all 5 container surfaces (Lua, Node, Zig, standalone-C, FFI-C)
and the shared test/test_container guard. Also: documented the printable-ASCII
passthrough in character_map.txt (verified behavior-neutral); fixed an FFI
NULL-deref (preserve_chars is a char* there, not an array).
All 17 aarch64-darwin nix checks green.
Copy file name to clipboardExpand all lines: bin/printable-binary-node.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -361,6 +361,13 @@ async function main() {
361
361
}
362
362
363
363
if(containerMode){
364
+
// Only --spaces is honored in container mode; --tabs/--crlf/-w/--preserve
365
+
// would put raw tab/CR/LF (or arbitrary chars) into the JSON value, breaking
366
+
// single-line-JSON validity and the tab/CR/LF-stripping transport-resistance.
367
+
if(tabsMode||crlfMode||preserveChars){
368
+
process.stderr.write('Error: --tabs/--crlf/-w/--preserve are not supported with --container (only --spaces is honored; other whitespace stays encoded)\n');
// Literal spaces were noise. If the space glyph is ALSO present, the payload
761
+
// mixed real (glyph) spaces with formatting spaces -> warn we dropped them.
762
+
constspaceGlyph=this.encodeMap.get(0x20);
763
+
if(spaceGlyph&&cleanData.includes(spaceGlyph)){
764
+
console.warn(`Warning: literal spaces in container data were assumed to be ignorable formatting because the space glyph ${spaceGlyph} was also present; stripping them`);
fprintf(stderr, "Warning: literal spaces in container data were assumed to be ignorable formatting because the space glyph %.*s was also present; stripping them\n", (int)sglen, sg);
0 commit comments