Skip to content

Commit

Permalink
Texinfo: allow spaces before line-breaking commands
Browse files Browse the repository at this point in the history
Bug: #497
Signed-off-by: Alexander Golubev <[email protected]>
  • Loading branch information
Fat-Zer authored and mquinson committed Nov 4, 2024
1 parent 2967c6a commit e12df03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Locale/Po4a/Texinfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -234,25 +234,25 @@ sub parse {
$self->push_docheader();
$self->pushline( $line . "\n" );
} elsif ( $closed
and ( $line =~ /^@([^ ]*?)(?: +(.*))?$/ )
and ( defined $commands{$1} )
and ( $break_line{$1} ) )
and ( $line =~ /(^\s*)@([^ ]*?)(?: +(.*))?$/ )
and ( defined $commands{$2} )
and ( $break_line{$2} ) )
{
my ($spaces, $cmd, $arg) = ($1, $2, $3);
if ( length($paragraph) ) {
( $t, @env ) = translate_buffer( $self, $paragraph, undef, @env );
$self->pushline($t);
$paragraph = "";
}
my $arg = $2;
my @args = ();
if ( defined $arg and length $arg ) {

# FIXME: keep the spaces ?
$arg =~ s/\s*$//s;
@args = ( " ", $arg );
}
( $t, @env ) = &{ $commands{$1} }( $self, $1, "", \@args, \@env, 1 );
$self->pushline( $t . "\n" );
( $t, @env ) = &{ $commands{$cmd} }( $self, $cmd, "", \@args, \@env, 1 );
$self->pushline( $spaces . $t . "\n" );
} else {

# continue the same paragraph
Expand Down

0 comments on commit e12df03

Please sign in to comment.