Skip Menu |

This queue is for tickets about the Text-Autoformat CPAN distribution.

Report information
The Basics
Id: 21466
Status: open
Priority: 0/
Queue: Text-Autoformat

People
Owner: Nobody in particular
Requestors: clinton [...] traveljury.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.13
Fixed in: (no value)



Subject: Not ignoring indented paras
I have some text which I am trying to format with: autoformat($text,{all=>1,ignore=>'indented'}) but the ignore is not working. The text: ================================== To login, please use this account: Email : joe@soap.com Password : AV3YKWPR kind regards ================================== The result: ================================== To login, please use this account: Email : joe.com Password : AV3YKWPR kind regards ================================== Additionnally, I tried with this: sub test { print "---------------\n$_\n------------\n"; return $_=~/^\s+/; } autoformat($text,{all=>1,ignore=>\&test) The result: ================================== --------------- To login, please use this account: ------------ To login, please use this account: Email : joe.com Password : AV3YKWPR kind regards ================================== It seems that my sub is only being called for the first para.
It seems the issue is with this bit of code, lines 271-284: my $remainder = ""; if ($args{all}) { # STOP AT MAIL TERMINATOR IF $args{mail} my $lastignored = 1; for my $index (0..$#paras) { local $_ = $paras[$index]{raw} . "\n"; $lastignored &&= $paras[$index]{ignore} = $args{ignore}($lastignored); next unless $args{mail} && /^--$/; $remainder = join "\n", map { $_->{raw} } splice @paras, $index; $remainder .= "\n" unless $remainder =~ /\n\z/; last; } } I'm not sure why you are using the $lastignored, but if you delete '$lastignored &&=', then the module works as it should (at least for this bit of text).
Text messed up by RT, the lines Email and Password should start with spaces Show quoted text
> > The text: > ================================== > To login, please use this account: > > Email : joe@soap.com > Password : AV3YKWPR > > kind regards > ==================================