Ref loc for cross ref not working for multi-chapter

I stumbled on another issue with references where multiple chapter spans aren’t pulling the correct verse lookup.

Example: From Hosea 1:1
<note caller="-" style="x"> <char style="xo" closed="false">1:1 </char> <char style="xt" closed="false"> <ref loc="2KI 14:23-29">2 Atriviba 14:23-29</ref>; <ref loc="2KI 15:1-7">15:1-7</ref>; <ref loc="2KI 15:32-38">15:32-38</ref>; <ref loc="2KI 16:1-20">16:1-20</ref>; <ref loc="2KI 18:1-20:21">18:1–20:21</ref>; <ref loc="2CH 26:1-23">2 Eghaghaniba 26:1-23</ref>; <ref loc="2CH 27:1-8">27:1-8</ref>; <ref loc="2CH 28:1-27">28:1-27</ref>; <ref loc="2CH 29:1-32:33">29:1–32:33</ref></char>

The refs in question are:
<ref loc="2KI 18:1-20:21">18:1–20:21</ref>;
<ref loc="2CH 29:1-32:33">29:1–32:33</ref>

Within the app, the popup window appears but displays, “2 Kings 18:1-20”. The second ref shows, 2 Chronicles 29:1-32.

We had this similar issue before in the TDX however those are using the /xt markup and we got that fixed by using semicolon. The multiple chapter ref in TDX work fine. Example, Jon 20:1-21:14; shows in the popup window, Jon 20:1-21:14.

Anyway, you have any thoughts on how to resolve this? Meaning the ref loc, should display on popup window the full reference, example from above, 2 Kings 18:1-20:21. Right now, the popup does not read the reference correctly and only shows, 2 Kings 18: 1-20, which is the the correct reference. This only happens with multi chapter references.

A regular hyphen is usually a verse range. A chapter range is usually a en or em dash.

I am a bit surprised, but I can only find some of the reference separators defined in SAB itself, but if you look in your .appdef file for the project more are defined. Close SAB first, then open the .appdef in a text editor.

Search for <features type="bc"> if you have multiple collections, then you need to change all of them separately. Below that find are these lines:

      <feature name="show-scripture-refs" value="true" />
      <feature name="layout-show-config-button" value="true" />
      <feature name="ref-chapter-verse-separator" value=":" />
      <feature name="ref-verse-range-separator" value="-" />
      <feature name="ref-verse-list-separator" value="," />
      <feature name="ref-chapter-range-separator" value="—" />
      <feature name="ref-chapter-list-separator" value=";" />
      <feature name="numerals-type" value="default" />

Only the first, third and fifth are available in the interface.
image

I believe SAB populates these from the Paratext Project. But as you are using USX, it can’t do that. If you change the <feature name="ref-chapter-range-separator" value="—" /> to a regular hyphen it may mess up your verse ranges. I’d suggest you convert your chapter ranges using Changes so they have an em dash.

Then let us know if the chapter range character was a hyphen? Does making the changes I suggest make it work?

Thank you Ian for help.

I currently have a change already in the app, find -- replace "\u2013 (which is en dash, I believe). Now that I look at that, this is only finding double dash. Note: the double dashes were being used in major references (example, 2–4), which I have now been taken care of. And they were used in this case we are dealing with now, multiple chapter ranges, 29:1--32:33. So I can confirm the change table in SAB does replace double dash to en dash \u2013.

Anyway, the en dash is just what is displayed in the app. The ref locator appears to be a hyphen. This is what we would need to change as this is what is being looked up. Therefore, it does look like a hyphen is being used for chapter range in the ref loc. My question, how would I change that (hyphen to en dash) only for the chapter ranges in the ref loc code? It looks like both verse and chapter ranges use the same hyphen currently.

I’d search for this type of pattern: :12-20:
Find: (:\d+)\-(\d+:)
Replace: \1\u2013\2

A regular verse range won’t have a colon following the second number.

Thanks for find/replace for the Changes in SAB. I applied the changes and verified with viewing ‘show after changes.’

before change: <ref loc="JHN 18:38-19:16">Jon 18:38--19:16</ref>
after change: <ref loc="JHN 18:38–19:16">Jon 18:38–19:16</ref>
As you see the hyphen was changed to en dash in the ref loc, and double dash to en dash as well. (Note: This is from Mark 15:6 parallel reference for John 18:38-19:16.)

In the app during testing, I still get the ref popup window, Jon 18:38-19. Which in this case, the window is blank as there is no Jon 18:38-19 text to display from the Bible.

To go back to original Hosea 1:1 example:
before: <ref loc="2CH 29:1-32:33">29:1--32:33</ref>
after: <ref loc="2CH 29:1–32:33">29:1–32:33</ref>
Still shows, 2 Chronicles 29:1-32 in ref popup window.

So the change was accepted and the ref loc changed to en dash as seen in code, however the app ref calling window doesn’t change to reflect the scripture text of the ref loc.

Update:
I also tried the change from hyphen to em dash (\u2014)
<ref loc="2CH 29:1—32:33">29:1–32:33</ref>
The result seemed even worse, the ref popup window only displays in this case, 2 Chronicles 29:1.

It looks like this should be defined (in the .appdef file) as an en-dash, instead of an em-dash. Maybe try changing that (with SAB closed)?

Still stuck…
I edited the .appdef file with text editor and changed this line of from hyphen to en dash (u2013):
<feature name="ref-chapter-range-separator" value="–"/>
Still no luck with getting multi chapter spanning references to view properly. The popup window still not does display full reference. I also tried em dash (u2014) and same result with editing the .appdef file.
Hum…not sure where to turn to next.

Looks like a bug to me. @mcquayi could you write that up in the bugs database? With the big push to get v10 out, I think the developers probably won’t be able to get to it for a few months…