Skip to content

Improve handling of chapter-less contexts #56

Description

@renehamburger

There are two issues with the current implementation, which can be seen in

it('works for reference without chapter (initial implementation)', async () => {
await testRecognition(
`<p data-bx-context="Matt">
Check out verse 9 and then 6:10 (cf. Luke 11:2)
and verse 11.
</p>`,
['verse 9', '6:10', 'Luke 11:2', 'verse 11'],
['Matt.1.9', 'Matt.6.10', 'Luke.11.2', 'Matt.1.11']
);
});
xit('works for reference without chapter (final implementation)', async () => {
await testRecognition(
`<p data-bx-context="Matt">
Check out verse 9 and then 6:10 (cf. Luke 11:2)
and verse 11.
</p>`,
['6:10', 'Luke 11:2', 'verse 11'],
['Matt.6.10', 'Luke.11.2', 'Matt.6.11']
);
});

As the given context does not contain a chapter:

  • chapter-less references within the section should take their chapter from any previously recognised passage in that section (rather than the chapter 1 supplied to the chapter-less context to allow parsing)
  • if a chapter-less reference has no preceding recognised passage, it should be skipped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions