diff options
author | Chris Little <chrislit@crosswire.org> | 2009-02-14 07:58:23 +0000 |
---|---|---|
committer | Chris Little <chrislit@crosswire.org> | 2009-02-14 07:58:23 +0000 |
commit | 7278a6a081abb173e1c331ecf678c4d89d1d2345 (patch) | |
tree | 67717e0e7877c1fe5c1b458b0603a04dfc4ffb0b /modules/perlconverters | |
parent | f414b053153e74f468c525d3a5da78058da75258 (diff) | |
download | sword-tools-7278a6a081abb173e1c331ecf678c4d89d1d2345.tar.gz |
added/corrected support for a few more tags
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@152 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/perlconverters')
-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\*//; |