info: Better support for multiline author entries.

parent 022e76bb
......@@ -53,7 +53,7 @@
</subtitle>
<author> + "@author "
</author>
</author> + "@ldt_endauthor"
<name>
</name>
......
......@@ -125,6 +125,9 @@ sub info_parse_raw_file {
my $lastnode = "";
my $sort = 0;
my $inauthor;
my $authorline;
open ($INPUT, "< $inputfile")
or die "info-postASP: Could not open $inputfile for read. Aborting ...\n";
......@@ -180,8 +183,22 @@ sub info_parse_raw_file {
$labels{$_} = $lastnode;
} elsif (s/^\@title\s+//){
$docdata{'title'} = $_;
} elsif (s/^\@author\s+//){
$docdata{'author'} = $_;
} elsif (/^\@ldt_endauthor/){
$inauthor = '';
my @authors;
if ( @$docdata{'authors'} ){
@authors = @$docdata{'authors'};
}
push @authors, $authorline;
$docdata{'authors'} = \@authors;
$authorline = "";
} elsif ( s/^\@author\s+// ){
$inauthor = 1;
$authorline = $_;
} elsif ( $inauthor ){
next if m/^\s*$/;
s/^\s+//;
$authorline .= " $_ ";
} elsif (s/^\@subtitle\s+//){
$docdata{'subtitle'} = $_;
} elsif (s/^\@ldt_translator\s+//){
......@@ -274,11 +291,11 @@ sub info_write_preprocessed_file {
}
} elsif (s/^\@TOP//){
$texinfo .= "\@node top\n"
. "\@top " . $docdata->{'title'} . "\n\n"
. "\@top " . $docdata->{'title'} . "\n"
. "\@example\n";
$texinfo .= $docdata->{'author'} . "\n"
if ( defined $docdata->{'author'} );
$texinfo .= join(' and ',@{$docdata->{'authors'}}) . "\n"
if ( @{$docdata->{'authors'}} );
$texinfo .= $docdata->{'subtitle'} . "\n"
if ( defined $docdata->{'subtitle'} );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment