summaryrefslogtreecommitdiffstats
path: root/modules/python/usfm2osis.py
diff options
context:
space:
mode:
authorPeter von Kaehne <refdoc@gmx.net>2014-03-15 09:07:51 +0000
committerPeter von Kaehne <refdoc@gmx.net>2014-03-15 09:07:51 +0000
commit45d37bb6862a92bc0999e4468bb78d8dae68c1cf (patch)
tree1dbd50f52fdd9ef951b1c8ccbffb5ea54bdf64b3 /modules/python/usfm2osis.py
parent95f9a48bfa46dac0267d7fd3c06e7a6d74452780 (diff)
downloadsword-tools-45d37bb6862a92bc0999e4468bb78d8dae68c1cf.tar.gz
improved handling of mulitiple \ipi, fixes MODTOOLS-50
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@484 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/python/usfm2osis.py')
-rwxr-xr-xmodules/python/usfm2osis.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/python/usfm2osis.py b/modules/python/usfm2osis.py
index 0cc631b..f8dcc9e 100755
--- a/modules/python/usfm2osis.py
+++ b/modules/python/usfm2osis.py
@@ -497,8 +497,8 @@ def convertToOsis(sFile):
# \imq_text...
# \ipr_text...
pType = {'ipi':'x-indented', 'im':'x-noindent', 'imi':'x-noindent-indented', 'ipq':'x-quote', 'imq':'x-noindent-quote', 'ipr':'x-right'}
- osis = re.sub(r'\\(ipi|im|ipq|imq|ipr)\s+(.*?)(?=(\\(i?m|i?p|lit|cls|tr|io|iq|i?li|iex?|s|c)\b|<(/?div|p|closer)\b))', lambda m: '\uFDD3<p type="' + pType[m.group(1)] + '" subType="x-introduction">\n' + m.group(2) + '\uFDD3</p>\n', osis, flags=re.DOTALL)
-
+ osis = re.sub(r'\\(ipi|im|ipq|imq|ipr)\s+(.*?)(?=(\\(i?m|i?p|lit|cls|tr|io|iot|ipi|iq|i?li|iex?|s|c)\b|<(/?div|p|closer)\b))', lambda m: '\uFDD3<p type="' + pType[m.group(1)] + '" subType="x-introduction">\n' + m.group(2) + '\uFDD3</p>\n', osis, flags=re.DOTALL)
+
# \iq#_text...
osis = re.sub(r'\\iq\b\s*(.*?)(?=(['+'\uFDD0\uFDD1\uFDD3\uFDD4'+r']|\\(iq\d?|fig|q\d?|b)\b|<title\b))', r'<l level="1" subType="x-introduction">\1</l>', osis, flags=re.DOTALL)
osis = re.sub(r'\\iq(\d)\b\s*(.*?)(?=(['+'\uFDD0\uFDD1\uFDD3\uFDD4'+r']|\\(iq\d?|fig|q\d?|b)\b|<title\b))', r'<l level="\1" subType="x-introduction">\2</l>', osis, flags=re.DOTALL)