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: 67896
Status: resolved
Priority: 0/
Queue: Parse-BBCode

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

Bug Information
Severity: Normal
Broken in: 0.11
Fixed in: 0.12_001



Subject: extra colon if no attribute on [code] tag
If I have [code]some code[/code] when rendered this module puts an extra colon on a line before the code is printed. : some code If I have an attribute like this, [code=perl]some code[/code] it renders like this: perl: some code I think if there is no attribute present it should not print the header/colon part above the code.
Hi, Am Mo 02. Mai 2011, 10:56:13, LOZIER schrieb: Show quoted text
> If I have [code]some code[/code] when rendered this module puts an
extra Show quoted text
> colon on a line before the code is printed. > > : > some code > > If I have an attribute like this, [code=perl]some code[/code] it
renders Show quoted text
> like this: > > perl: > some code > > I think if there is no attribute present it should not print the > header/colon part above the code.
Can you show the code used to render code tags? I don't have a code tag in the Parse::BBCode::HTML defaults. If you define your own code tag, you should be able to check if there is an attribute or not and then decide if you display a colon or not...
Oh sorry, of course there is a code tag in the defaults. I can change the tags to using a subroutine that can check the attribute. Same with the quote tag. I thought in the most cases people would want to define their own code tag so I spent not too much time on this. Until I change this you can use something like this: tags => { code => { code => sub { my ($parser, $attr, $content) = @_; my $title = 'Code'; if ($attr) { $title = Parse::BBCode::escape_html($attr); } $content = Parse::BBCode::escape_html($$content); return <<"EOM"; <div class="bbcode_code_header">$title: <div class="bbcode_code_body">$content</div></div> EOM }, parse => 0, class => 'block', }, }, }
Am Sa 07. Mai 2011, 17:22:50, TINITA schrieb: Show quoted text
> I can change the tags to using a subroutine that can check the > attribute. Same with the quote tag.
I have changed it in version 0.12_001 Can you test it if it looks ok to you?
Subject: Re: [rt.cpan.org #67896] extra colon if no attribute on [code] tag
Date: Tue, 10 May 2011 16:53:13 -0700
To: bug-Parse-BBCode [...] rt.cpan.org
From: "Brian E. Lozier" <brian [...] massassi.com>
It now says "Code:" if the attribute is blank. Looks good thanks! On Tue, May 10, 2011 at 9:25 AM, Tina Muller via RT <bug-Parse-BBCode@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=67896 > > > Am Sa 07. Mai 2011, 17:22:50, TINITA schrieb: >
>> I can change the tags to using a subroutine that can check the >> attribute. Same with the quote tag.
> > I have changed it in version 0.12_001 > > Can you test it if it looks ok to you? >