revise 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/cli.js +10 -5
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Fixed
6
+
7
+ - **Windows-1252 text on Node 20.** Text that isn't UTF-8, like a .txt file
8
+ from a Windows editor piped to `convert`, and RTF files read € “ ” ‘ ’ – —
9
+ and the other characters Windows-1252 stores in bytes 0x80–0x9F as
10
+ invisible control characters. Node 22 and later were not affected.
11
+
3
12
  ## 3.0.0
4
13
 
5
14
  The first release of `revise` as a command-line tool and TypeScript library
package/cli.js CHANGED
@@ -579,11 +579,16 @@ function utf8Of(bytes) {
579
579
  return bytes;
580
580
  } catch {
581
581
  if (bytes.includes(0)) return bytes;
582
- return new TextEncoder().encode(
583
- new TextDecoder("windows-1252").decode(bytes)
584
- );
582
+ return new TextEncoder().encode(windows1252(bytes));
585
583
  }
586
584
  }
585
+ var WINDOWS_1252_C1 = "\u20AC\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\u017D\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\u017E\u0178";
586
+ function windows1252(bytes) {
587
+ return new TextDecoder("windows-1252").decode(bytes).replace(
588
+ /[\u0080-\u009f]/g,
589
+ (char) => WINDOWS_1252_C1[char.charCodeAt(0) - 128]
590
+ );
591
+ }
587
592
  function utf16Of(bytes) {
588
593
  if (bytes[0] === 255 && bytes[1] === 254) return "utf-16le";
589
594
  if (bytes[0] === 254 && bytes[1] === 255) return "utf-16be";
@@ -832,8 +837,8 @@ var ui = PLAIN;
832
837
  var uiErr = PLAIN;
833
838
  function producer() {
834
839
  return {
835
- version: true ? "3.0.0" : "dev",
836
- build: true ? "a60344a6f" : null
840
+ version: true ? "3.0.1" : "dev",
841
+ build: true ? "7ef88f310" : null
837
842
  };
838
843
  }
839
844
  var warnings = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "revise",
3
- "version": "3.0.0",
4
- "reviseBuild": "a60344a6f",
3
+ "version": "3.0.1",
4
+ "reviseBuild": "7ef88f310",
5
5
  "description": "Read, edit, and redline Word documents from the command line or TypeScript, with tracked changes, comments, and tools for AI agents.",
6
6
  "keywords": [
7
7
  "docx",
@@ -55,7 +55,7 @@
55
55
  ],
56
56
  "sideEffects": false,
57
57
  "dependencies": {
58
- "@reviseio/engine": "3.0.0",
58
+ "@reviseio/engine": "3.0.1",
59
59
  "jszip": "^3.10.1",
60
60
  "yjs": "^13.6.27"
61
61
  },