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

Retain paragraph type during import

    Details

      Description

      Usfm2osis.py generates paragraphs having many different values for type (such as x-center, x-right, x-noindent etc.). Currently this information is lost when importing to SWORD because during the transformation of <p> to milestone <div type="x-p"> the paragraph type attributes are just dropped. Instead, can they be copied to the div's subType so they can be retained and accessed later, something like:

      SWBuf tagName = t.getName();
      if (!t.isEndTag()) {
      // Transform <p> into <div type="x-p"> and milestone it
      if (tagName == "p") {
      + SWBuf subType = t.getAttribute("type");
      t.setText("<div type=\"x-p\" />");
      sprintf(buf, "gen%d", sID++);
      t.setAttribute("sID", buf);
      + if (subType.length())

      {t.setAttribute("subType", subType);}

      }

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: