diff options
author | Chris Little <chrislit@crosswire.org> | 2012-03-09 09:23:40 +0000 |
---|---|---|
committer | Chris Little <chrislit@crosswire.org> | 2012-03-09 09:23:40 +0000 |
commit | fb4fa5b33845d74c3c88ef7a6f23899927a84d68 (patch) | |
tree | 1a7b8e66e43c8a997137c0be815bb91cc6a17b9c /modules/perlconverters | |
parent | a38a09e6e9ab88e23e38c9110a090927040e1c54 (diff) | |
download | sword-tools-fb4fa5b33845d74c3c88ef7a6f23899927a84d68.tar.gz |
made \wj handling a little more robust (so that it now tolerates crossing linebreaks)
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@355 07627401-56e2-0310-80f4-f8cd0041bdcd
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; |