Skip to content

Commit a8902f2

Browse files
committed
Texinfo: allow spaces before line-breaking commands
Bug: mquinson#497 Signed-off-by: Alexander Golubev <[email protected]>
1 parent 4e7b5f3 commit a8902f2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Locale/Po4a/Texinfo.pm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,25 +234,25 @@ sub parse {
234234
$self->push_docheader();
235235
$self->pushline( $line . "\n" );
236236
} elsif ( $closed
237-
and ( $line =~ /^@([^ ]*?)(?: +(.*))?$/ )
238-
and ( defined $commands{$1} )
239-
and ( $break_line{$1} ) )
237+
and ( $line =~ /(^\s*)@([^ ]*?)(?: +(.*))?$/ )
238+
and ( defined $commands{$2} )
239+
and ( $break_line{$2} ) )
240240
{
241+
my ($spaces, $cmd, $arg) = ($1, $2, $3);
241242
if ( length($paragraph) ) {
242243
( $t, @env ) = translate_buffer( $self, $paragraph, undef, @env );
243244
$self->pushline($t);
244245
$paragraph = "";
245246
}
246-
my $arg = $2;
247247
my @args = ();
248248
if ( defined $arg and length $arg ) {
249249

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

258258
# continue the same paragraph

0 commit comments

Comments
 (0)