Skip Menu |

This queue is for tickets about the Parse-BBCode CPAN distribution.

Maintainer(s)' notes

If you have any wishes, feel free to create a ticket.

Plans:

I would like to add callbacks to the parser so that you can gather some information about specific tags and ideally can manipulate them during parsing.

But there are already enough informations to create a download link for code tags, for example. See example/code_download.pl.

Parse::BBCode is now hosted on github, so for bug reports also check https://github.com/perlpunk/Parse-BBCode

Report information
The Basics
Id: 45718
Status: resolved
Priority: 0/
Queue: Parse-BBCode

People
Owner: Nobody in particular
Requestors: redneb [...] gmx.com
Cc:
AdminCc:

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



Subject: Cannot use the same tags hash more than once
Date: Tue, 5 May 2009 01:24:50 -0400
To: bug-Parse-BBCode [...] rt.cpan.org
From: redneb [...] gmx.com
In the following code my %tags=(Parse::BBCode::XHTML->defaults); my $bb1=Parse::BBCode::XHTML->new({tags=>\%tags}); my $bb2=Parse::BBCode::XHTML->new({tags=>\%tags}); print "FAIL\n" if $bb1->render("\n") ne $bb2->render("\n"); the two BBCode objects do not produce the same output despite being created with the same parameters. The first one gives the correct output which is "<br />\n", but the second one gives "\n". The reason seems to be that the Parse::BBCode::XHTML->new method modifies the %tags hash in a way that the new hash is not equivalent with the original one. This is why the following works just fine: my %tags=(Parse::BBCode::XHTML->defaults); my $bb1=Parse::BBCode::XHTML->new({tags=>{%tags}}); my $bb2=Parse::BBCode::XHTML->new({tags=>{%tags}}); print "FAIL\n" if $bb1->render("\n") ne $bb2->render("\n"); I think the constructor should make a private copy of this hash so that it can modify it safely.
On Di. 05. Mai 2009, 01:25:41, redneb@gmx.com wrote: Show quoted text
> I think the constructor should make a private copy of this hash so
that Show quoted text
> it can modify it safely.
thanks for the report, that's correct and should be easy to fix. I have a minor change waiting to be released, so I hope to upload a new version soon. tina