diff options
Diffstat (limited to 'modules/perlconverters/usfm2osis.pl')
-rw-r--r-- | modules/perlconverters/usfm2osis.pl | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/modules/perlconverters/usfm2osis.pl b/modules/perlconverters/usfm2osis.pl index 2e651f2..fdc0933 100644 --- a/modules/perlconverters/usfm2osis.pl +++ b/modules/perlconverters/usfm2osis.pl @@ -474,8 +474,8 @@ foreach $file (@files) { $line =~ s/\\v\b\s*(\d[^\\ ]*)? *//; } - ### Paragraphs--Markers Supported: \p, \b, \m - #### Markers Not Yet Supported: \m, \pmo, \pm, \pmc, \pmr, \pi#, \mi, \nb, \cls, \li#, \pc, \pr, \ph#, \b + ### Paragraphs--Markers Supported: \p, \b, \m, \nb + #### Markers Not Yet Supported: \m, \pmo, \pm, \pmc, \pmr, \pi#, \mi, \cls, \li#, \pc, \pr, \ph#, \b # Hack to solve an issue in a module that used <R> for linebreaks in the usfm files--may be commented out (not USFM 2.1) $line =~ s/\\lb\*/<lb \/>/g; @@ -488,10 +488,20 @@ foreach $file (@files) { $line =~ s/\\p\b\s*//; } + # \pc paragraph centered (From Chapters and Verses) + if ($line =~ /^\\pc\b\s*/) { + push (@outdata, closeTag("<\/p>")); + push (@outdata, "<p type=\"x-center\">\n"); + openTag("<\/p>"); + $line =~ s/\\pc\b\s*//; + } + # \b $line =~ s/\\b\b//; # \m $line =~ s/\\m\b//; + # \nb + $line =~ s/\\nb\b//; ### Poetry--Markers Supported: \q#, \qs...\qs*, \qc, \qm# #### Markers Not Yet Supported: \qr, \qa, \qac...\qac*, \b @@ -610,8 +620,8 @@ foreach $file (@files) { return $ref; } - ### Footnotes--Markers Supported: \fk, \fq, \f...\f*, \fv - ####Markers Not Yet Supported: \fe...\fe*, \fr, \fqa, \fl, \fp, \ft, \fdc...\fdc*, \fm...\fm* + ### Footnotes--Markers Supported: \fk, \fq, \f...\f*, \fv, \fqa + ####Markers Not Yet Supported: \fe...\fe*, \fr, \fl, \fp, \ft, \fdc...\fdc*, \fm...\fm* sub footnoteHandler { $note = @_[0]; @@ -628,20 +638,28 @@ foreach $file (@files) { $note =~ s/\\fq\s(.+?)(?=\\f)/<catchWord>$1<\/catchWord>/g; $note =~ s/\\fq\*//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; + # \fv Footnote verse number - $note =~ s/\\fv\s*(\d+)\b\s*(?=\\f)/<reference osisID=\"$book.$vers.$1\">$1<\/reference>/g; - + $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; + # \fr Footnote origin reference (the verse where the fn appears) - while ($note =~ /\\fr\s*(.+?)\s*(?=\\x)/) { + while ($note =~ /\\fr\s*(.+?)\s*(?=\\f)/) { $sourceVal = parseRef($1); $nFN++; -# $note =~ s/\\fr\s*(.+?)\s*(?=\\x)//; +# $note =~ s/\\fr\s*(.+?)\s*(?=\\f)//; $note =~ s/\\fr\s*//; $note =~ s/<note>/<note n="$nFN">/; } # \ft Footnote text $note =~ s/\\ft\s//g; + $note =~ s/\\ft\*//g; # \f* Footnote closer $note =~ s/\\f\*//; |