Reference range - can use non-breaking hyphen?

I built a Bible app which has some issues with reference ranges. First of all, the source text I have uses a variety of regular hyphens and non-breaking hyphens, but mostly the latter. Not very helpful, but that’s what I have to work with for now. In the app I built, if a reference uses a non-breaking hyphen for a range, the verses after the non-breaking hyphen wouldn’t be included, e.g. in a reference like this: (Lk 3.23-38), the underline of the link doesn’t go past the non-breaking hyphen, and clicking the underlined part would only bring up verse 23, not the range. That’s not surprising, and if I add this change on the Changes tab:

  <find>(\d)\u2011(\d)</find>
  <replace>\1-\2</replace>

then that non-breaking hyphen changes to a regular hyphen, and in the app built the underline extends to include “-38”, and the full range is now referenced if I tap on it. So far, so good.

I was thinking, however, that I might prefer to use the non-breaking hyphen in reference ranges, so that I would avoid this sort of thing:

There are a couple of settings for Scripture References if you select the book collection, and go to the Features tab, but it only has Chapter-Verse Separator and List of Verses. Being the clever guy that I am, I went to the .appDef file for the project and looked there, and sure enough I found just what I wanted:

  <feature name="ref-verse-range-separator" value="‑" />
  <feature name="ref-chapter-range-separator" value="‑" />

I changed those range separators to U+2011 Non-breaking hyphen (those lines above have in fact already been changed), restarted SAB, reversed my change in the Changes tab:

  <find>(\d)-(\d)</find>
  <replace>\1\u2011\2</replace>

so that all of the hyphens between numbers are changed to non-breaking hyphens, and…

All the reference ranges broke again. My guess is that even though those two range-separators are defined in the .appDef file, they aren’t actually used in the code, it is just hard-coded to use a normal hyphen. After all, those fields don’t seem to be available in the user interface of SAB, so maybe they aren’t supposed to be changed.

Can someone confirm that for me? Or am I missing something that would allow me to use non-breaking hyphens for my reference ranges?

Hello Jeff,

I checked the code and it doesn’t look like it is using ref-verse-range-separator or ref-chapter-range-separator any more (they seem to be legacy settings).

I see the code that does the parsing. I have tested a change and submitted it for review.

Chris

Super! Thanks for your help!

A fix has been submitted. It will support the non-breaking hyphenations by default. It will be in the next version after 4.5.

Chris