Skip to content

Commit bb9a2dc

Browse files
authored
scribe, perf-react: fix verse location for header (#242)
- for matter before chapter 1, default chapter to 1 (rather then 0)
1 parent 291b618 commit bb9a2dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/scribe/src/plugins/ScriptureReferencePlugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function $findAndSetChapterAndVerse(
116116
if (!startNode) return false;
117117

118118
const chapterNode = $findThisChapter(startNode);
119-
const selectedChapterNum = parseInt(chapterNode?.getNumber() ?? "0", 10);
119+
const selectedChapterNum = parseInt(chapterNode?.getNumber() ?? "1", 10);
120120
const verseNode = $findThisVerse(startNode);
121121
const verse = verseNode?.getNumber();
122122
// For verse ranges this returns the first number.

packages/shared-react/plugins/ScriptureReferencePlugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default function ScriptureReferencePlugin({
123123
const verseNum = parseInt(verse ?? "0", 10);
124124
const reference: ScriptureReference = {
125125
book: book ?? "",
126-
chapterNum: parseInt(chapterNode?.getAttribute("data-number") ?? "0", 10),
126+
chapterNum: parseInt(chapterNode?.getAttribute("data-number") ?? "1", 10),
127127
verseNum,
128128
};
129129
if (verse != null && verseNum.toString() !== verse) reference.verse = verse;

0 commit comments

Comments
 (0)