Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only parse details fields that are requested
At the moment, we are putting the entire contents of the `details` field through the `DetailsPresenter`, which is sub-optimal as we are parsing values that clients are not requesting. By using lookaheads, we can determine which fields from `details` have been requested and only parse those. In a previous prototype, we had only transformed the govspeak in the `body` field. However the schemas can permit mixed govspeak/HTML content in any details field. We therefore need to parse all items within `details`, as is already done using the `DetailsPresenter`. Note: the code here could've been simpler (i.e. not duplicate the object, just slice the details hash) but the `ContentEmbedPresenter` requires a full `Edition` object.
- Loading branch information