[sword-svn] r312 - trunk/modules/perlconverters
chrislit at crosswire.org
chrislit at crosswire.org
Fri Nov 5 15:51:21 MST 2010
Author: chrislit
Date: 2010-11-05 15:51:21 -0700 (Fri, 05 Nov 2010)
New Revision: 312
Modified:
trunk/modules/perlconverters/usfm2osis.pl
Log:
move <verse eID=""/> upward, above lines that start with title, div, and p elements
Modified: trunk/modules/perlconverters/usfm2osis.pl
===================================================================
--- trunk/modules/perlconverters/usfm2osis.pl 2010-11-05 22:27:45 UTC (rev 311)
+++ trunk/modules/perlconverters/usfm2osis.pl 2010-11-05 22:51:21 UTC (rev 312)
@@ -961,7 +961,7 @@
close (INF);
open (OUTF, ">:utf8", "$outputFilename");
-#bubble chapter down
+# bubble chapter down
for ($i = 0; $i < scalar(@filedata); $i++) {
if (@filedata[$i] =~ /^<\// && @filedata[$i-1] =~ /^<chapter.+\/>/) {
$temp = @filedata[$i];
@@ -970,7 +970,19 @@
$i -= 2;
}
}
+
+# bubble verse end up
+# CCL--this may require further attention, but works for the present
for ($i = 0; $i < scalar(@filedata); $i++) {
+ if (@filedata[$i-1] =~ /^(<title|<\/?div|<\/?p)/ && @filedata[$i] =~ /^<verse eID.+\/>/) {
+ $temp = @filedata[$i];
+ @filedata[$i] = @filedata[$i-1];
+ @filedata[$i-1] = $temp;
+ $i -= 2;
+ }
+}
+
+for ($i = 0; $i < scalar(@filedata); $i++) {
$fullfile .= @filedata[$i];
}
$fullfile =~ s/<\/osisText>\n<\/osis>\n(<chapter eID[^>]+>)/$1\n<\/osisText>\n<\/osis>/mg; #swap the chapter back up one before the osisText closer
More information about the sword-cvs
mailing list