Skip to content

Commit

Permalink
Allow chapter 0 and verse 0 in normalisation for prologues
Browse files Browse the repository at this point in the history
  • Loading branch information
TechWilk committed Nov 13, 2024
1 parent 5f3a6b1 commit 60cb795
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ public function normalise(string $chapter, string $verse): ?array
$verse = trim($verse);
$verse = ltrim($verse, '0');

if (strlen($chapter) < 1) {
// prologues are usually represented as chapter 0
$chapter = '0';
}

if (strlen($verse) < 1) {
// prologues may be represented as verse 0
$verse = '0';
}

if (!array_key_exists($chapter, $this->transformations)) {
return null;
}
Expand Down

0 comments on commit 60cb795

Please sign in to comment.