From 45d37bb6862a92bc0999e4468bb78d8dae68c1cf Mon Sep 17 00:00:00 2001 From: Peter von Kaehne Date: Sat, 15 Mar 2014 09:07:51 +0000 Subject: 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 --- modules/python/usfm2osis.py | 4 ++-- 1 file 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

\n' + m.group(2) + '\uFDD3

\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

\n' + m.group(2) + '\uFDD3

\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|\1', osis, flags=re.DOTALL) osis = re.sub(r'\\iq(\d)\b\s*(.*?)(?=(['+'\uFDD0\uFDD1\uFDD3\uFDD4'+r']|\\(iq\d?|fig|q\d?|b)\b|\2', osis, flags=re.DOTALL) -- cgit