[sword-svn] r287 - trunk/modules/perlconverters

chrislit at crosswire.org chrislit at crosswire.org
Tue Jul 13 02:05:57 MST 2010


Author: chrislit
Date: 2010-07-13 02:05:57 -0700 (Tue, 13 Jul 2010)
New Revision: 287

Modified:
   trunk/modules/perlconverters/usfm2osis.pl
Log:
attempt at dealing with a bug in handling footnote-internal tags that were being clobbered

Modified: trunk/modules/perlconverters/usfm2osis.pl
===================================================================
--- trunk/modules/perlconverters/usfm2osis.pl	2010-07-12 05:21:09 UTC (rev 286)
+++ trunk/modules/perlconverters/usfm2osis.pl	2010-07-13 09:05:57 UTC (rev 287)
@@ -770,25 +770,25 @@
 	    $note = "<note>$note</note>";
 
 	    # \fk Catch Words
-	    $note =~ s/\\fk\s(.+?)\\fk\*/<catchWord>$1<\/catchWord>/g;
-	    $note =~ s/\\fk\s(.+?)(?=\\f)/<catchWord>$1<\/catchWord>/g;
-	    $note =~ s/\\fk\*//g;
+	    $note =~ s/\\fk\s(.+?)\\fk\*/\\fX<catchWord>$1<\/catchWord>\\fX/g;
+	    $note =~ s/\\fk\s(.+?)(?=\\f)/\\fX<catchWord>$1<\/catchWord>\\fX/g;
+	    $note =~ s/\\fk\*/\\fX/g;
 
 	    # \fq Quotations in Footnotes
 	    # CCL--I don't know the difference, aside from length, between catch words and quotations in footnotes. It may vary by document.
-	    $note =~ s/\\fq\s(.+?)\\fq\*/<catchWord>$1<\/catchWord>/g;
-	    $note =~ s/\\fq\s(.+?)(?=\\f)/<catchWord>$1<\/catchWord>/g;
-	    $note =~ s/\\fq\*//g;
+	    $note =~ s/\\fq\s(.+?)\\fq\*/\\fX<catchWord>$1<\/catchWord>\\fX/g;
+	    $note =~ s/\\fq\s(.+?)(?=\\f)/\\fX<catchWord>$1<\/catchWord>\\fX/g;
+	    $note =~ s/\\fq\*/\\fX/g;
 
 	    # \fqa Alternate translations in Footnotes
-	    $note =~ s/\\fqa\s(.+?)\\fqa\*/<rdg type=\"alternate\">$1<\/rdg>/g;
-	    $note =~ s/\\fqa\s(.+?)(?=\\f)/<rdg type=\"alternate\">$1<\/rdg>/g;
-	    $note =~ s/\\fqa\*//g;
+	    $note =~ s/\\fqa\s(.+?)\\fqa\*/\\fX<rdg type=\"alternate\">$1<\/rdg>\\fX/g;
+	    $note =~ s/\\fqa\s(.+?)(?=\\f)/\\fX<rdg type=\"alternate\">$1<\/rdg>\\fX/g;
+	    $note =~ s/\\fqa\*/\\fX/g;
 
 	    # \fv Footnote verse number
-	    $note =~ s/\\fv\s(.+?)\\fv\*/<reference osisID=\"$book.$chap.$1\">$1<\/reference>/g;
-	    $note =~ s/\\fv\s*(\d+)\b\s*(?=\\f)/<reference osisID=\"$book.$chap.$1\">$1<\/reference>/g;
-	    $note =~ s/\\fv\*//g;
+	    $note =~ s/\\fv\s(.+?)\\fv\*/\\fX<reference osisID=\"$book.$chap.$1\">$1<\/reference>\\fX/g;
+	    $note =~ s/\\fv\s*(\d+)\b\s*(?=\\f)/\\fX<reference osisID=\"$book.$chap.$1\">$1<\/reference>\\fX/g;
+	    $note =~ s/\\fv\*/\\fX/g;
 
 	    # \fr Footnote origin reference (the verse where the fn appears)
 	    while ($note =~ /\\fr\s*(.+?)\s*(?=\\f)/) {
@@ -809,6 +809,9 @@
 	    # \f Footnote opener
 	    $note =~ s/\\f\b\s*([^\s]\s*)?//;
 
+	    # \fX was inserted above to mark former locations of various already-handled markers, which can now be removed
+	    $note =~ s/\\fX//g;
+
 	    return $note;
 	}
 




More information about the sword-cvs mailing list