Subject: | Lists may not be rendered sometimes |
I am using Text::WikiFormat 0.03 with MacOS X's default Perl (5.6.0).
I have created an unordered list (by prefixing items with a tab a * and a space), but Text::WikiFormat renders this as <code>.
I suspect this is due to the use of "keys %{ $tags{lists} }" in line 73 of WikiFormat.pm. There is no way of telling which order the keys will be returned in - if "code" is returned before "unordered", code will be macthed first (code's qr/$indent/ match will also catch unordered's qr/$indent\*\s*/).
I changed line 73 to a hardcoded qw(ordered unordered code paragraph) which fixed this problem, but seemed to create a new problem of placing each list item in a separate list.
Of course, on different environments the hash might happen to be ordered such that this error does not occur. However, the following code may reproduce the error:
[A separate issue is that empty paragraphs are created due to a blank line between the paragraph and the unordered list, although this is less of a problem]
#!/usr/bin/perl -Tw
use strict;
use Text::WikiFormat ();
my $data = join('', <DATA>);
my $html = Text::WikiFormat::format($data, undef) or die $!;
print "$html\n";
__DATA__
Title Here
Here is some text with a [link] in it. Here is a link to [http://www.example.com|an example site].
and some more...
* one Are these
* two bullets?
1. my ordered list
2. and its second item
Let me know if you need any further information.
Thanks,
Tom Hukins