Proskomma / proskomma-json-tools

Tools for working with Proskomma-derived JSON formats such as PERF and SOFRIA
MIT License
1 stars 2 forks source link

Add and use unresolved graft events #6

Closed mvahowe closed 1 year ago

mvahowe commented 1 year ago

This PR unrolls the previous ignoreMissingGrafts strategy, because in some cases missing grafts need to be handled.

The new strategy adds

to ProskommaRender, which throws an error if these events are called and if no action is set for them. The events may be ignored by adding an empty action (as in the unit test) or handled in some other way.

I've only added these events to PerfRenderFromJson because SOFRIA has all grafts inline, and because PerfRenderFromProskomma should always provide all the grafts (since the events are generated from Proskomma internals, not arbitrary JSON).

Tests pass.

DanielC-N commented 1 year ago

good fix. LGTM