Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Headings at the start of chapters do not get relocated

Open
#524 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with VerseRef.ChangeVersification and trace how headings such as MAL 4:0/1:s1 are represented and converted. Then inspect UpdateUsfmParserHandler and the Serval pretranslation flow, using the Malachi example as the reproduction case. Done means headings at the start of a chapter remain in the generated USFM after versification changes.

Written by the indexing model from the issue text.

Description

I'm not sure this can be fixed.

Given the book Malachi with a source with the English Versification, and a target with the Septuagint Versification, most references will be converted correctly, e.g. MAL 4:1 -> MAL 3:19, and Serval will use these in the Pretranslations stored in Mongo. i.e.:

{
  "textId": "MAL",
  "sourceRefs": ["MAL 4:1"],
  "targetRefs": ["MAL 3:19"],
  "refs": ["MAL 3:19"],
  "translation": "“For behold, the day is coming, burning like a furnace, when all the arrogant and every evildoer will be stubble; the day is coming when I will set them ablaze,” says the LORD of Hosts. “Not a root or branch will be left to them.”",
}

However, if there were headings at the start of chapter 4, VerseRef.ChangeVersification will not convert the source reference to a suitable target reference:

{
  "textId": "MAL",
  "sourceRefs": ["MAL 4:0/1:s1"],
  "targetRefs": ["MAL 4:0/1:s1"],
  "refs": ["MAL 4:0/1:s1"],
  "translation": "The Day of the LORD",
}

Which means that the final USFM outputted by Serval using the UpdateUsfmParserHandler will lose the headings, i.e.:

\v 18 So you will again distinguish between the righteous and the wicked, between those who serve God and those who do not.”
\s1 
\r 
\m
\v 19 “For behold, the day is coming, burning like a furnace, when all the arrogant and every evildoer will be stubble; the day is coming when I will set them ablaze,” says the LORD of Hosts. “Not a root or branch will be left to them.” 

I'm not sure what we can do? Check if the next verse is being relocated, and move any headings to the verse before that one???

Dominant language
C#
Stars
29
Forks
17
Avg merge
4d 15h
Merged PRs (30d)
8

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sillsdev/machine

All issues in sillsdev/machine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.