oparkins / Ayia

A Bible App
GNU General Public License v3.0
1 stars 0 forks source link

Version parsing is loosing data when there is no verse 1 #7

Closed depeele closed 8 months ago

depeele commented 8 months ago

I've found one version (GNT) that has a book without a verse 1 (1 Samuel 13). In this case, we're loosing a portion of the data prior to the first occurring verse (in this case, verse 2).

In GNT, 1 Samuel doesn't actually have a verse 1. It just has a note about the fact that verse one doesn't appear in one ancient translation.

We're loosing this note, which should be placed in our version 1 placeholder.

Current, the version 1 placeholder is only receiving the chapter heading (War against the Philistines) and looks like:

  [ { s: 'War against the Philistines'}  }

It is missing the note.f and SHOULD look like:

  [ { s: 'War against the Philistines'} ,
    { note.f: [
        { label: '#' },
        { ft: ' ' },
        { fr: '13.1: ' },
        { ft: ' ' },
        { ft: 'One ancient translation does not have verse 1; Hebrew has as verse 1 ' },
        { ft: ' ' },
        { fq: 'Saul was … years old when he became king, and he was king of Israel for two years. ' },
        { ft: ' ' }
      ]
    }
  ]

The source HTML:

 <!-- { -->
 <div class="version vid68 iso6393eng" data-vid="68" data-iso6393="eng">
  <div class="book bk1SA"><!-- { -->
   <div class="chapter ch13 frag3925" data-usfm="1SA.13"><!-- { -->
    <div class="label">13</div>
    <div class="s">
     <span class="heading">War against the Philistines</span>
    </div>
    <div class="p"><!-- { -->
     <!-- ==============================================================
          In this case, we seem to be loosing all of this content
          prior to the first verse which, in this case, is 1SA.13.2
       -->
     <span class="content"> </span>
     <span class="note f">
      <span class="label">#</span>
      <span class=" body">
       <span class="ft"> </span>
       <span class="fr">13.1: </span>
       <span class="ft"> </span>
       <span class="ft">One ancient translation does not have verse 1; Hebrew has as verse 1 </span>
       <span class="ft"> </span>
       <span class="fq">Saul was … years old when he became king, and he was king of Israel for two years. </span>
       <span class="ft"> </span>
       <span class="ft">The Hebrew text is defective at two points in this verse.</span>
       <span class="ft"> </span>
      </span>
     </span>
     <span class="content"> </span>
     <!-- ============================================================== -->
     <span class="verse v2" data-usfm="1SA.13.2">
      <span class="label">2</span>
      <span class="content">Saul picked three thousand men, keeping two thousand of them with him in Michmash and in the hill country of Bethel and sending one thousand with his son Jonathan to Gibeah, in the territory of the tribe of Benjamin. The rest of the men Saul sent home.</span>
     </span>
    </div><!-- } p -->

    <div class="p"><!-- { -->
     <span class="verse v2" data-usfm="1SA.13.2">
     <span class="content"> </span>
     </span>
     <span class="verse v3" data-usfm="1SA.13.3"><!-- { -->
      <span class="label">3</span>
      <span class="content">Jonathan killed the Philistine commander</span>
      <span class="note f">
       <span class="label">#</span>
       <span class=" body">
        <span class="fr">13.3: </span>
        <span class="fq">killed the Philistine commander; </span>
        <span class="ft">or </span>
        <span class="fq">defeated the Philistines camping.</span>
       </span>
      </span>
      <span class="content"> in Geba, and all the Philistines heard about it. Then Saul sent messengers to call the Hebrews to war by blowing a trumpet throughout the whole country. </span>
     </span><!-- verse v3 } -->
     <!-- ... -->
    </div><!-- } p -->
   </div><!-- } chapter ch13 -->
  </div><!-- } book -->
 </div><!-- } version vid68 -->
depeele commented 8 months ago

Closed with ed83afddc1bb3b6e106ebcecae906ff1be5bea27