Skip Menu |

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

Report information
The Basics
Id: 56136
Status: open
Priority: 0/
Queue: Text-WikiCreole

People
Owner: Nobody in particular
Requestors: peter_retep [...] gmx.de
Cc:
AdminCc:

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



Subject: unitialized value warning on parsing a hashmark with linebreak
Date: Wed, 31 Mar 2010 03:19:01 +0200
To: bug-Text-WikiCreole [...] rt.cpan.org
From: Peter Retep <peter_retep [...] gmx.de>
on parsing a # with a following newline, Text::WikiCreole outputs a warning in concatenation of $html and calling parse() recursively. perl -e 'use Text::WikiCreole;print Text::WikiCreole::creole_parse("#\n")' Use of uninitialized value in concatenation (.) or string at /usr/local/share/perl/5.10.0/Text/WikiCreole.pm line 545. <ol> </ol> perl -v This is perl, v5.10.0 built for i486-linux-gnu-thread-multi grep "VERSION =" /usr/local/share/perl/5.10.0/Text/WikiCreole.pm our $VERSION = "0.07"; if($t && $chunks{$ch}{contains}) { # if it contains other chunks... $html .= parse(\$t, $ch); # recurse. } else { $html .= $t; # otherwise, print it } $html .= $chunks{$ch}{close}; # print the close tag
Subject: PATCH - unitialized value warning on parsing a hashmark with linebreak
On 2010-03-30 21:19:23, peter_retep@gmx.de wrote: Show quoted text
> on parsing a # with a following newline, Text::WikiCreole outputs a
warning Show quoted text
> in concatenation of $html and calling parse() recursively. > > perl -e 'use Text::WikiCreole;print Text::WikiCreole::creole_parse("#\n")' > Use of uninitialized value in concatenation (.) or string at > /usr/local/share/perl/5.10.0/Text/WikiCreole.pm line 545.
The parser's patterns don't allow for that case. Changing two lines as follows appears to fix the problem, and still pass the module's tests: li => { - curpat => '(?=`[^\*\#])', - fwpat => '\n(?=`[^\*\#])', + curpat => '(?=`(?:[^\*\#]|$))', + fwpat => '\n(?=`(?:[^\*\#]|$))', stops => '\n(?=`)', hint => ['`'], filter => sub { $_[0] =~ s/` *//o; chomp $_[0]; return $_[0]; }, contains => \@all_inline, open => " <li>", close => "</li>\n", },