Skip to content

Commit f5259ab

Browse files
committed
Fix numeric hash type handling
1 parent 764f583 commit f5259ab

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/__tests__/parsers/interlinearXmlParser.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,28 @@ describe('InterlinearXmlParser', () => {
7676
expect(result.Verses['RUT 3:1'].Hash).toBe('ABC123');
7777
});
7878

79+
it('parses purely numeric verse Hash', () => {
80+
const xml = `
81+
<InterlinearData ScrTextName="MyProject" GlossLanguage="en" BookId="RUT">
82+
<Verses>
83+
<item>
84+
<string>RUT 3:1</string>
85+
<VerseData Hash="123456">
86+
<Cluster>
87+
<Range Index="1" Length="2" />
88+
<Lexeme Id="x" />
89+
</Cluster>
90+
</VerseData>
91+
</item>
92+
</Verses>
93+
</InterlinearData>
94+
`;
95+
const result = parser.parse(xml);
96+
97+
expect(result.ScrTextName).toBe('MyProject');
98+
expect(result.Verses['RUT 3:1'].Hash).toBe('123456');
99+
});
100+
79101
it('parses cluster with multiple lexemes and builds LexemesId and Id correctly', () => {
80102
const xml = `
81103
<InterlinearData GlossLanguage="en" BookId="MAT">

src/parsers/interlinearXmlParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class InterlinearXmlParser {
197197
ignorePiTags: true,
198198
trimValues: true,
199199
parseTagValue: false,
200-
parseAttributeValue: true,
200+
parseAttributeValue: false,
201201
isArray: (_tagName, jPath) => {
202202
return [
203203
'InterlinearData.Verses.item',

0 commit comments

Comments
 (0)