Skip to content

Text props: an unknown writing-system handle is saved as ws="", which no reader can load #411

Open

Description

@johnml1135

When a text property holds a writing-system handle the writing-system factory does not know, TsPropsSerializer / TsStringSerializer write ws="" (the id lookup returns empty). Both the StyleRules reader and the run reader reject an empty ws, so the object fails to load ("corrupted record").

Found while reviewing #410 (it predates that PR).

Repro: build props or a run with ws (or baseWs) set to a handle not registered in the factory, serialize, then deserialize.

Suggested fix: the writer should never emit ws="": leave the attribute out (and log) or fail at the point the unknown handle is set; optionally make the reader tolerate an empty ws by dropping it. Add round-trip tests alongside TextPropsRoundTripTests.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions