Skip Menu |

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

Report information
The Basics
Id: 21431
Status: resolved
Priority: 0/
Queue: Text-Trac

People
Owner: Nobody in particular
Requestors: hanenkamp [...] cpan.org
Cc: GTERMARS [...] cpan.org
AdminCc:

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



Subject: Text::Trac::UlNode::parse has unintended return value
The parse method of Text::Trac::UlNode ends with the line: $c->htmllines($l); This returns an array that gets appended after each list item. I've patched the problem by adding: return; Just before the end. Cheers, Andrew
On Mon Sep 11 17:45:56 2006, HANENKAMP wrote: Show quoted text
> The parse method of Text::Trac::UlNode ends with the line: > > $c->htmllines($l); > > This returns an array that gets appended after each list item. I've > patched the problem by adding: > > return;
Have encountered same problem here, and can verify that the fix outlined above does address the problem.
After running a few more tests through locally, I see that "DLNode.pm" also suffers from the same issue here. What seems to make a difference (for me, at least) is that I'm not indenting the initial list item with a single space, but am using two spaces. The Trac WikiFormatting docs state "...there must be one or more spaces preceding the list item markers...", and I'm just in the habit of using two. This also has the unintended consequence of adding a blockquote around the lists.
Thanks for your reports and sorry for late my response.It seems that mails to mizzy@cpan.org are not forwarded to my gmail account. I fixed the UlNode.pm, DlNode.pm and BlockquoteNode.pm. I put the fixed version on my subversion repository.So you can get it like this: $ svn co http://svn.mizzy.org/public/library/perl/trunk/Text-Trac/ Please check this and I'd be very greateful. Thanks. -- Gosuke Miyashita
From: GTERMARS [...] cpan.org
On Thu Oct 26 21:46:39 2006, MIZZY wrote: Show quoted text
> I fixed the UlNode.pm, DlNode.pm and BlockquoteNode.pm. > > I put the fixed version on my subversion repository.So you can get > it like this: > > $ svn co http://svn.mizzy.org/public/library/perl/trunk/Text-Trac/
I've tested the version you've got in SVN, and it fixes the problems I was seeing with UL lists, but I'm still seeing issues with DL and OL lists. I've attached to this message a test suite that you can use to verify the issue. For "OlNode.pm", I found that putting the "return" at the end of "parse()" fixed the problem identified by this test suite, but I haven't had a chance to see what needs to be done to fix up the OL/DL nodes (it comes back with extra <blockquote>s when you use two spaces to indent the OL/DL lists too).
use strict; use Test::More tests => 8; BEGIN { use_ok( 'Text::Trac' ); } ############################################################################### instantiation: { my $trac = Text::Trac->new(); isa_ok( $trac, 'Text::Trac' ); } ############################################################################### ul_node_single_space: { my $trac = Text::Trac->new(); my $text = qq{ * indent with * single space * sublist with * two spaces }; my $expect = qq{<ul><li>indent with</li> <li>single space</li> <ul><li>sublist with</li> <li>two spaces</li></ul></ul>}; my $html = $trac->parse( $text ); is( $trac->html, $expect, 'UL node, single space indentation' ); } ############################################################################### ul_node_double_space: { my $trac = Text::Trac->new(); my $text = qq{ * indent with * two spaces * sublist with * two spaces }; my $expect = qq{<ul><li>indent with</li> <li>two spaces</li> <ul><li>sublist with</li> <li>two spaces</li></ul></ul>}; my $html = $trac->parse( $text ); is( $trac->html, $expect, 'UL node, double space indentation' ); } ############################################################################### ol_node_single_space: { my $trac = Text::Trac->new(); my $text = qq{ 1. indent with 1. single space a. sublist with a. two spaces }; my $expect = qq{<ol start="1"><li>indent with</li> <li>single space</li> <ol class="loweralpha"><li>sublist with</li> <li>two spaces</li></ol></ol>}; my $html = $trac->parse( $text ); is( $trac->html, $expect, 'OL node, single space indentation' ); } ############################################################################### ol_node_double_space: { my $trac = Text::Trac->new(); my $text = qq{ 1. indent with 1. two spaces a. sublist with a. two spaces }; my $expect = qq{<ol start="1"><li>indent with</li> <li>two spaces</li> <ol class="loweralpha"><li>sublist with</li> <li>two spaces</li></ol></ol>}; my $html = $trac->parse( $text ); is( $trac->html, $expect, 'OL node, double space indentation' ); } ############################################################################### dl_node_single_space: { my $trac = Text::Trac->new(); my $text = qq{ title1:: indent title single space title2:: indent content double space }; my $expect = qq{<dl> <dt>title1</dt> <dd> indent title single space </dd> <dt>title2</dt> <dd> indent content double space </dd> </dl>}; my $html = $trac->parse( $text ); is( $trac->html, $expect, 'DL node, single space indentation' ); } ############################################################################### dl_node_double_space: { my $trac = Text::Trac->new(); my $text = qq{ title1:: indent title double space title2:: indent content double space }; my $expect = qq{<dl> <dt>title1</dt> <dd> indent title double space </dd> <dt>title2</dt> <dd> indent content double space </dd> </dl>}; my $html = $trac->parse( $text ); is( $trac->html, $expect, 'DL node, double space indentation' ); }
Hi, Graham Thanks for your sending test suites.They are very very useful for my fixing bugs. I've fixed bugs you reported and included your test suites in my tests. I've updated the module on my subversion repos.Please check it. I also appreciate your feature requests.I'll consider them. Thanks. -- Gosuke Miyashtia
On Fri Oct 27 03:02:40 2006, MIZZY wrote: Show quoted text
> Thanks for your sending test suites.They are very very useful for my > fixing bugs. > > I've fixed bugs you reported and included your test suites in my
tests. Show quoted text
> > I've updated the module on my subversion repos.Please check it.
Thanks for the timely response Gosuke. I've given the latest version a whirl and it looks great. I'd be satisfied in closing this bug out.
Uploaded to CPAN as 0.05. Thanks a lot!