Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="2.1.0"></a>
## 2.1.0 (2026-08-16)

Sweeps the remaining open defects on `iarna/rtf-parser` and adopts two stalled upstream
pull requests. Each change has a regression test built from the reporter's own repro.

### Bug Fixes

* **interpreter:** accept both the signed and unsigned forms of `\uN`. The spec writes code
units above 32767 as negative; many producers emit the unsigned value, and `writeInt16LE`
threw `ERR_OUT_OF_RANGE` on those — a crash, not a bad character. Also fixes the emoji
surrogate-pair break, since both halves exceed 32767. Adopts upstream PR #28 by @UKayeF,
extended so the signed form keeps working. Closes upstream #28, completes #40.
* **interpreter:** map `\fcharset238` to CP1250 and make `\ansicpg1256` available. `CP238`
was never a code page and iconv never knew it, so east-European fonts threw. Adopts
upstream PR #33 by @facue. Closes upstream #30, #33.
* **interpreter:** decode the Symbol font rather than throwing on it. `\fcharset2` is a
glyph set, not a code page; it is how Word writes bullets, and it took whole documents
down. Adds the Adobe Symbol table for 0xA0..0xFE. Any charset iconv does not recognise now
falls back to CP1252 with a debug note instead of aborting. Closes upstream #15.
* **interpreter:** skip `\pict` payloads instead of emitting them as text — image hex was
landing in the document content and corrupting text extraction. Closes upstream #32.

### Dependencies

* **deps:** drop `readable-stream` — only `Writable` and `Transform` were used, both built
into node. Runtime dependencies go from two to one.
* **deps:** `iconv-lite@^0.7.3` (was `^0.4.15`, dated 2018). Closes upstream #37.

<a name="2.0.0"></a>
## 2.0.0 (2026-08-13)

Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ On a real 315k-character manuscript this recovers 1,966 apostrophes, 1,943 quota
marks and 308 en dashes, and eliminates 4,059 invisible control characters — bringing the
extracted length to exactly the `\nofchars` count the authoring tool recorded.

## Upstream issues this fork closes

Beyond the defects above, this fork resolves the open reports on
[iarna/rtf-parser](https://github.com/iarna/rtf-parser) that are bugs rather than feature
requests. Where the reporter supplied a reproduction, that exact input is the test.

| Upstream | What was wrong |
|---|---|
| [#41](https://github.com/iarna/rtf-parser/issues/41) | Styles lost inside a group — `{\i text}` came back unstyled |
| [#40](https://github.com/iarna/rtf-parser/issues/40) | `\uN` downlevel fallback emitted as a literal `?` |
| [#38](https://github.com/iarna/rtf-parser/issues/38) | Umlauts written as `\uN` came through doubled |
| [#37](https://github.com/iarna/rtf-parser/issues/37) | Dependencies years out of date |
| [#32](https://github.com/iarna/rtf-parser/issues/32) | `\pict` image hex leaked into the document text |
| [#30](https://github.com/iarna/rtf-parser/issues/30) | `\fcharset238` mapped to a code page that does not exist |
| [#15](https://github.com/iarna/rtf-parser/issues/15) | Symbol font (bullets) threw; emoji surrogate pairs threw |

Two stalled upstream pull requests are adopted with credit:

- **[#28](https://github.com/iarna/rtf-parser/pull/28)** by [@UKayeF](https://github.com/UKayeF) — `\uN` unsigned overflow. Their diagnosis was right; the fix here handles the signed form too, which a straight swap to `writeUInt16LE` would have broken.
- **[#33](https://github.com/iarna/rtf-parser/pull/33)** by [@facue](https://github.com/facue) — `\fcharset238` → CP1250, and CP1256 added.

[**#29**](https://github.com/iarna/rtf-parser/pull/29) by [@wwwildcat](https://github.com/wwwildcat) proposed six of the named character control words; this fork emits those and eight more. They got there first, five years earlier.

**Not addressed:** [#35](https://github.com/iarna/rtf-parser/issues/35) (tables) is a substantial feature, not a defect. [#34](https://github.com/iarna/rtf-parser/issues/34) is a support question about callbacks.

## Usage

```js
Expand Down
Loading