diff options
Diffstat (limited to 'modules/python/usfm2osis.py')
-rwxr-xr-x | modules/python/usfm2osis.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/python/usfm2osis.py b/modules/python/usfm2osis.py index 239378b..e16c486 100755 --- a/modules/python/usfm2osis.py +++ b/modules/python/usfm2osis.py @@ -628,12 +628,12 @@ def convertToOsis(sFile): ctext = matchObject.group(1) cp = re.search(r'\\cp\s+(.+?)(?=(\\|\s))', ctext) if cp: - ctext = re.sub(r'\\cp\s+(.+?)\\cp*', '', ctext, flags=re.DOTALL) + ctext = re.sub(r'\\cp\s+(.+?)(?=(\\|\s))', '', ctext, flags=re.DOTALL) cp = cp.group(1) ctext = re.sub(r'"\$BOOK\$\.([^"\.]+)"', '"$BOOK$.'+cp+'"', ctext) ca = re.search(r'\\ca\s+(.+?)\\ca\*', ctext) if ca: - ctext = re.sub(r'\\ca\s+(.+?)\\ca*', '', ctext, flags=re.DOTALL) + ctext = re.sub(r'\\ca\s+(.+?)\\ca\*', '', ctext, flags=re.DOTALL) ca = ca.group(1) ctext = re.sub(r'(osisID="\$BOOK\$\.[^"\.]+)"', r'\1 $BOOK$.'+ca+'"', ctext) return ctext @@ -658,14 +658,14 @@ def convertToOsis(sFile): """ vtext = matchObject.group(1) - vp = re.search(r'\\vp\s+(.+?)\\vp*', vtext) + vp = re.search(r'\\vp\s+(.+?)\\vp\*', vtext) if vp: - vtext = re.sub(r'\\vp\s+(.+?)\\vp*', '', vtext, flags=re.DOTALL) + vtext = re.sub(r'\\vp\s+(.+?)\\vp\*', '', vtext, flags=re.DOTALL) vp = vp.group(1) - vtext = re.sub(r'"\$BOOK\$\.\$CHAP\$\.([^"\.]+)"', '"$BOOK$.$CHAP$.'+va+'"', vtext) + vtext = re.sub(r'"\$BOOK\$\.\$CHAP\$\.([^"\.]+)"', '"$BOOK$.$CHAP$.'+vp+'"', vtext) va = re.search(r'\\va\s+(.+?)\\va\*', vtext) if va: - vtext = re.sub(r'\\va\s+(.+?)\\va*', '', vtext, flags=re.DOTALL) + vtext = re.sub(r'\\va\s+(.+?)\\va\*', '', vtext, flags=re.DOTALL) va = va.group(1) vtext = re.sub(r'(osisID="\$BOOK\$\.\$CHAP\$\.[^"\.]+)"', r'\1 $BOOK$.$CHAP$.'+va+'"', vtext) return vtext |