adyeths / u2o

USFM to OSIS bible format converter.
The Unlicense
18 stars 6 forks source link

\li is not well form during convertion #115

Closed LAfricain closed 2 years ago

LAfricain commented 2 years ago

If we have a \li tag at the end of a verse the tag is written like this <verse eID="Rev.22.19" /></item> </list> it should be: </item> </list><verse eID="Rev.22.19" />. Example with the usfm tag and the osis tags following:

...
\li (4) The life of God which is the believer is an unsevered part of the life which eternally was, and eternally is, in Christ Jesus--one life, in Him and in the believer--Vine and branches; Head and members @@reference osisRef="1co 6:17"µµ1 Corinthians 6:17@@/referenceµµ; @@reference osisRef="ga 2:20"µµGalatians 2:20@@/referenceµµ; @@reference osisRef="col 1:27"µµColossians 1:27@@/referenceµµ; @@reference osisRef="col 3:3 col 3:4"µµ 3:3,4@@/referenceµµ; @@reference osisRef="1jo 5:11 1jo 5:12"µµ1 John 5:11,12@@/referenceµµ; @@reference osisRef="joh 15:1-5"µµJohn 15:1-5@@/referenceµµ @@reference osisRef="1co 12:12-14"µµ1 Corinthians 12:12-14@@/referenceµµ.

Gives this:

<hi type="bold">life</hi> Eternal life, Summary of the teaching:
</p>
<list>
<item type="x-indent-1">(1) The life is called "eternal" because it was from the eternity which is past unto the eternity which is to come--it is the life of God revealed in Jesus Christ, who is God <reference osisRef="joh 1:4">John 1:4</reference>; <reference osisRef="joh 5:26"> 5:26</reference>; <reference osisRef="1jo 1:1 1jo 1:2">1 John 1:1,2</reference></item>
<item type="x-indent-1">(2) This life of God, which was revealed in Christ, is imparted in a new birth by the Holy Spirit, acting upon the word of God, to every believer on the Lord Jesus Christ <reference osisRef="joh 3:3-15">John 3:3-15</reference>.</item>
<item type="x-indent-1">(3) The life thus imparted was from the beginning." But the recipient is a "new creation" <reference osisRef="2co 5:17">2 Corinthians 5:17</reference>; <reference osisRef="ga 6:15">Galatians 6:15</reference>.</item>
<item type="x-indent-1">(4) The life of God which is the believer is an unsevered part of the life which eternally was, and eternally is, in Christ Jesus--one life, in Him and in the believer--Vine and branches; Head and members <reference osisRef="1co 6:17">1 Corinthians 6:17</reference>; <reference osisRef="ga 2:20">Galatians 2:20</reference>; <reference osisRef="col 1:27">Colossians 1:27</reference>; <reference osisRef="col 3:3 col 3:4"> 3:3,4</reference>; <reference osisRef="1jo 5:11 1jo 5:12">1 John 5:11,12</reference>; <reference osisRef="joh 15:1-5">John 15:1-5</reference> <reference osisRef="1co 12:12-14">1 Corinthians 12:12-14</reference>. <verse eID="Rev.22.19" /></item>
</list>

It can be even worse:

<item type="x-indent-1">(7) that suffering is disciplinary, <reference osisRef="1pe 4:17-19">1 Peter 4:17-19</reference>; <reference osisRef="1co 11:31 1co 11:32">1 Corinthians 11:31,32</reference>; <reference osisRef="heb 12:5-13">Hebrews 12:5-13</reference>.
<verse eID="1Pet.1.7" />
<verse sID="1Pet.1.9" osisID="1Pet.1.9" n="9" /><hi type="bold">salvation</hi></item>
</list>
adyeths commented 2 years ago
  1. I would need to see more complete examples than these fragments. A link to the sources would be sufficient.
  2. I see you have extra non-usfm markup in the source. u2o is not going to understand or work well with markup that isn't usfm. It will get confused because it expects only usfm markup. I can't provide support when there is extra non-usfm markup in the source. Proper usfm markup is required for u2o to work correctly.
LAfricain commented 2 years ago

I see you have extra non-usfm markup in the source.

Yes but this doesn't matter for the issue. I tried without this markup and the problem is the same. In the attached file I copied 3 chapter of Revelation without the extra non-usfm markup.

rev.zip

adyeths commented 2 years ago

I'm not sure I'm going to be able to make u2o work properly for commentaries like you're trying to do. I'm not even sure usfm was ever intended to be used for commentaries. I will have to do more thinking on this.

LAfricain commented 2 years ago

Hi

work properly for commentaries like you're trying to do

This file is only an example, the problem remains with a bible. It's possible to have table in introductions.

m not even sure usfm was ever intended to be used for commentaries

No idea about that but it's working perfectly! And an easy way to convert to other format, like wikis.

adyeths commented 2 years ago

In order for me to fix issues in u2o I need to see the actual files that are problematic. I won't be able to tell where the problem is otherwise.

adyeths commented 2 years ago

I haven't been able to find anything in the usfm documentation to indicate tables are allowed in introductions. Lists are allowed, but I see nothing for tables.

LAfricain commented 2 years ago

Hi, Why are speaking about tables? Tables work fine with u2o.py. The problem is actually the lists.

LAfricain commented 2 years ago

Hi, Why are speaking about tables? Tables work fine with u2o.py. The problem is actually the lists.

adyeths commented 2 years ago

I mentioned tables because you said in a previous comment "It's possible to have table in introductions."...

With regards to this issue, as far as I can tell the lists are converted properly. So it's not an issue with lists. The placement of chapter/verse markers is problematic though. That should be reported under a separate issue and the files that are problematic for conversion need to be shared with me or I won't be able to try and fix the issue.

LAfricain commented 2 years ago

Hi Ryan,

I mentioned tables because you said in a previous comment "It's possible to have table in introductions."...

My mistake! I wanted to say list...

That should be reported under a separate issue and the files that are problematic for conversion need to be shared with me or I won't be able to try and fix the issue.

You can find the usfm files here: https://gitlab.com/crosswire-bible-society/scofield/-/tree/main/usfm Don't take care to the @@reference strange tags.