mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Fix verse commentary validator to allow apostrophes and verse ranges
Updated the VerseCommentary validation regex pattern to support: - Apostrophes in book names (e.g., "Solomon's Song") - Verse ranges (e.g., "Genesis 1:4-5") This brings the validator in line with other validators in the codebase and fixes failing data validation tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -132,7 +132,7 @@ class VerseCommentary(RootModel[Dict[str, VerseCommentaryEntry]]):
|
||||
@classmethod
|
||||
def check_verse_keys(cls, v):
|
||||
import re
|
||||
pattern = r'^[A-Za-z0-9 ]+ \d+:\d+$'
|
||||
pattern = r"^[A-Za-z0-9 ']+ \d+:\d+(-\d+)?$"
|
||||
for key in v.keys():
|
||||
if not re.match(pattern, key):
|
||||
raise ValueError(f"Invalid verse reference key: {key}")
|
||||
|
||||
Reference in New Issue
Block a user