[sword-svn] r387 - trunk/modules/python

chrislit at crosswire.org chrislit at crosswire.org
Mon Aug 13 20:55:12 MST 2012


Author: chrislit
Date: 2012-08-13 20:55:12 -0700 (Mon, 13 Aug 2012)
New Revision: 387

Modified:
   trunk/modules/python/usfm2osis.py
Log:
support footnote/crossref character-level end tags by default


Modified: trunk/modules/python/usfm2osis.py
===================================================================
--- trunk/modules/python/usfm2osis.py	2012-08-13 16:26:11 UTC (rev 386)
+++ trunk/modules/python/usfm2osis.py	2012-08-14 03:55:12 UTC (rev 387)
@@ -684,15 +684,8 @@
         # \fv_
         note = re.sub(r'\\fv\b\s(.+?)(?=(\\f|'+u'﷟))', u'﷟'+r'<hi type="super">\1</hi>', note)
 
-        if relaxedConformance:
-            note = note.replace(r'\fq*', '')
-            note = note.replace(r'\fqa*', '')
-            note = note.replace(r'\ft*', '')
-            note = note.replace(r'\fr*', '')
-            note = note.replace(r'\fk*', '')
-            note = note.replace(r'\fl*', '')
-            note = note.replace(r'\fp*', '')
-            note = note.replace(r'\fv*', '')
+        # \fq*,\fqa*,\ft*,\fr*,\fk*,\fl*,\fp*,\fv*
+        note = re.sub(r'\\f(q|qa|t|r|k|l|p|v)\*', '', note)
 
         note = note.replace(u'﷟', '')
         return note
@@ -748,11 +741,8 @@
             # \xtSeeAlso...\xtSeeAlso: Concordance and Names Index markup for an additional entry target reference.
             note = re.sub(r'\\xtSeeAlso\b\s(.+?)\\xtSeeAlso\b\*', u'﷟'+r'<reference osisRef="\1">See also: \1</reference>', note)
 
-        if relaxedConformance:
-            note = note.replace(r'\xq*', '')
-            note = note.replace(r'\xt*', '')
-            note = note.replace(r'\xo*', '')
-            note = note.replace(r'\xk*', '')
+        # \xq*,\xt*,\xo*,\xk*
+        note = re.sub(r'\\f(q|t|o|k)\*', '', note)
 
         note = note.replace(u'﷟', '')
         return note




More information about the sword-cvs mailing list