diff options
Diffstat (limited to 'modules/perlconverters')
-rw-r--r-- | modules/perlconverters/usfm2osis.pl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/perlconverters/usfm2osis.pl b/modules/perlconverters/usfm2osis.pl index fca3542..e8ecc7d 100644 --- a/modules/perlconverters/usfm2osis.pl +++ b/modules/perlconverters/usfm2osis.pl @@ -87,6 +87,8 @@ $usfmVersion = "2.2"; # The USFM reference document can be found at http://www.u $divOpen=false; +$wj = 0; # number of \wj's we've encountered + # Generates a list of available encodings. use Encode; @encodingList = Encode->encodings(":all"); @@ -940,7 +942,15 @@ foreach $file (@files) { $line =~ s/\\add\b\s*(.*?)\\add\*/<transChange type=\"added\">$1<\/transChange>/g; # \wj...\wj*, Words of Jesus - $line =~ s/\\wj\b\s*(.*?)\\wj\*/<q who="Jesus" marker="">$1<\/q>/g; + sub wjCount { + if (@_[0] eq "") { + $wj++; + return "sID=\"q.$wj\" "; + } + return "eID=\"q.$wj\" "; + } + #$line =~ s/\\wj\b\s*(.*?)\\wj\*/<q who="Jesus" marker="">$1<\/q>/g; + $line =~ s/\\wj\b(\*?)\s*/"<q " . wjCount($1) . "who=\"Jesus\" marker=\"\"\/>"/eg; # \pb, page break $line =~ s/\\pb\b/<milestone type=\"pb\"\/>/g; |