diff options
-rw-r--r-- | modules/perlconverters/usfm2osis.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/perlconverters/usfm2osis.pl b/modules/perlconverters/usfm2osis.pl index a6eb7e0..9ef2be1 100644 --- a/modules/perlconverters/usfm2osis.pl +++ b/modules/perlconverters/usfm2osis.pl @@ -376,6 +376,44 @@ foreach $file (@files) { $line = "<p>$1<\/p>"; } + # \im introduction quotation (implemented as ordinary quotation) + if ($line =~ /^\\imq\b\s*(.*)/) { + $line = "<q>$1<\/q>"; + } + + + # \iq line (including \iq#), adapted from \q (see below), needs more clean-up + if ($line =~ /^\\iq/) { + if ($l != 1) { + push (@outdata, "<lg>\n"); + $l = 1; + } + if ($line =~ /\\iq(\d*)$/) { + if ($1 eq "") { + $line = "<l>\n"; + } + else { + $line = "<l level=\"$1\">\n"; + } + @filedata[$i+1] .= "<\/l>"; + if (@filedata[$i+2] !~ /\\iq(?!t)/) { + @filedata[$i+1] .= "\n<\/lg>"; + $l = 0; + } + } + else { + $line =~ s/\\iq\b\s*(.+)/<l>$1<\/l>/; + $line =~ s/\\iq(\d+)\b\s*(.+)/<l level=\"$1\">$2<\/l>/; + if (@filedata[$i+1] !~ /\\iq(?![ta])/) { + $line .= "\n<\/lg>"; + $l = 0; + } + } + } + + + + # \ie introduction end (discard) if ($line =~ /^\\ie\b/) { $line = ""; |