Uploaded image for project: 'Module Tools'
  1. Module Tools
  2. MODTOOLS-95

majorSection titles are not always imported properly- and sometimes drops text

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: osis2mod
    • Labels:

      Description

      The majorSection osis2mod.cpp patch of Dec 2014 seems to assume majorSection titles are never pre-verse titles. But often majorSection titles are just titles, or a series of titles, which are best treated as pre-verse titles.

      Also, majorSection titles are sometimes followed by scope titles: <title type="scope"> forming a compound title, and the scope title is considered pre-verse. So in this case what should be a single title block is split into two, with the majorSection title in the introduction and its scope title separated into the pre-verse group.

      Also sometimes majorSection titles appear in the Bible or Testament introduction. When this happens, the wrong state is entered, and the introduction material after the majorSection title is lost.

      Maybe majorSection titles should be treated like regular section titles (which are pre-verse) unless one is known to be followed by non-title material and then it should be appended to the current introduction (which is not always the chapter introduction)?

        Attachments

          Activity

          Hide
          johnaustin John Austin added a comment -

          I found out the original patch had nothing to do with majorSection titles being followed by introductory material (MODTOOLS-77). So I think all these breakages (including the original issue in 2014) can be solved by having osis2mod treat majorSection divs as another section div in terms of pre-verse content. Then, majorSection headings and all following headings should always proceed their following verse and not end up stuck at the end of an introduction.

          The fix is then to just remove the majorSection patch of Dec 2014 (now lines 889-917) and change osis2mod.cpp line 966 from:

          if ((tokenName == "div" && typeAttr == "section") ||

          to

          if ((tokenName == "div" && (typeAttr.endsWith("section") || typeAttr.endsWith("Section"))) ||

          or for good measure, the following would also prevent any real introduction title at the end of an intro from ever getting removed from there and stuck with the next verse:

          if ((tokenName == "div" && (typeAttr.endsWith("section") || typeAttr.endsWith("Section")) && token.getAttribute("subType") != "x-introduction") ||

          This also addresses MODTOOLS-94.

          Show
          johnaustin John Austin added a comment - I found out the original patch had nothing to do with majorSection titles being followed by introductory material ( MODTOOLS-77 ). So I think all these breakages (including the original issue in 2014) can be solved by having osis2mod treat majorSection divs as another section div in terms of pre-verse content. Then, majorSection headings and all following headings should always proceed their following verse and not end up stuck at the end of an introduction. The fix is then to just remove the majorSection patch of Dec 2014 (now lines 889-917) and change osis2mod.cpp line 966 from: if ((tokenName == "div" && typeAttr == "section") || to if ((tokenName == "div" && (typeAttr.endsWith("section") || typeAttr.endsWith("Section"))) || or for good measure, the following would also prevent any real introduction title at the end of an intro from ever getting removed from there and stuck with the next verse: if ((tokenName == "div" && (typeAttr.endsWith("section") || typeAttr.endsWith("Section")) && token.getAttribute("subType") != "x-introduction") || This also addresses MODTOOLS-94 .
          Hide
          scribe Troy A Griffitts added a comment - - edited

          Thanks John,
          We've just reverted the majorSection patch, looking toward a release soon. I am not sure I am clear about the reason for your suggestion to add another condition check to pick it up, referenced by line 966, above. Is there a need to do anything special with these div blocks? I had a look at the OSIS manual and their definition is very vague. Not sure we could come up with anything which would make everyone who uses them happy.

          Thanks for all the feedback on this.

          Troy

          Show
          scribe Troy A Griffitts added a comment - - edited Thanks John, We've just reverted the majorSection patch, looking toward a release soon. I am not sure I am clear about the reason for your suggestion to add another condition check to pick it up, referenced by line 966, above. Is there a need to do anything special with these div blocks? I had a look at the OSIS manual and their definition is very vague. Not sure we could come up with anything which would make everyone who uses them happy. Thanks for all the feedback on this. Troy
          Hide
          johnaustin John Austin added a comment -

          The proposed change to line 966 would treat all these section headings the same way as regards their preverse div designation: majorSection, section, subSection, subSubSection, etc.. As it is currently, the code designates only "section" headings as being preverse, which seems like a bug. This results in undesired placement of the other types of section headings because without the preverse div, they are treated as introductory material (when they are actually also pre-verse material for the following verse, rather than being part of the previous introduction). I don't see how this correction would make anyone unhappy. But it should fix a strange problem.
          -john

          Show
          johnaustin John Austin added a comment - The proposed change to line 966 would treat all these section headings the same way as regards their preverse div designation: majorSection, section, subSection, subSubSection, etc.. As it is currently, the code designates only "section" headings as being preverse, which seems like a bug. This results in undesired placement of the other types of section headings because without the preverse div, they are treated as introductory material (when they are actually also pre-verse material for the following verse, rather than being part of the previous introduction). I don't see how this correction would make anyone unhappy. But it should fix a strange problem. -john

            People

            • Assignee:
              chrislit Chris Little
              Reporter:
              johnaustin John Austin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: