[sword-devel] usfm2osis.pl poor handling of minor section headings
Peter von Kaehne
refdoc at gmx.net
Thu Sep 3 09:29:59 MST 2009
Peter von Kaehne wrote:
> Currently usfm2osis.pl appears to mishandle minor section headings:
>
> _______________________________________
Looking at the source code it appears there is a specific difference in
the handling of \s2 vs \s1 and \s3, \s4 etc.. See here:
# \s \s1 section (From Chapters and Verses)
if ($line =~ /^\\s1?\b\s*(.+)/) {
push (@outdata, closeTag("<\/p>"));
push (@outdata, closeTag("<\/div type=\"section\">"));
push (@outdata, "<div type=\"section\">\n");
openTag("<\/div type=\"section\">");
$line =~ s/\\s1?\b\s*(.+)/<title>$1<\/title>/;
if ($line =~ /HEBREW TITLE/) {
$line =~ s/<title>/<title type=\"psalm\">/;
}
}
# \ss \s2 subSection (From Chapters and Verses)
if ($line =~ /^\\s[s2]\b\s*(.+)/) {
$line =~ s/\\s[s2]\b\s*(.+)/<title>$1<\/title>/;
}
# \sss \s3 x-subsubSection (From Chapters and Verses)
if ($line =~ /^\\s(ss|3)\b\s*(.+)/) {
push (@outdata, closeTag("<\/p>"));
push (@outdata, closeTag("<\/div
type=\"x=subSubSection\">"));
push (@outdata, "<div type=\"x-subSubSection\">\n");
openTag("<\/div type=\"x-subSubSection\">");
$line =~ s/\\s(ss|3)\b\s*(.+)/<title>$2<\/title>/;
\s2 is not creating a <div>. Is there a specific reason?
Peter
More information about the sword-devel
mailing list