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

People
Owner: Nobody in particular
Requestors: dzirtik [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.13_003
Fixed in: 0.13_004



Subject: Some problems with parse attributes
When you parsing a atributes for a tag, your RE lookes like: $attr =~ s/^(?:"([^"]+)"|(.*?)(?:\s+|$))// AND $attr =~ s/^([a-zA-Z0-9]+)=(?:"([^"]+)"|(.*?)(?:\s+|$))// But there is a problem if space will be after ", so RE IMHO must be: $attr =~ s/^(?:"([^"]+)"|(.*?))(?:\s+|$)// AND $attr =~ s/^([a-zA-Z0-9]+)=(?:"([^"]+)"|(.*?))(?:\s+|$)// In addition, I would like to be able to use single quotes, like: [tag foo='bar'] and attributes with underscore (_), like: [tag foo_bar='boo'] So, I think RE must look like: $attr =~ s/^(?:"([^"]+)"|(.*?)|'([^']+)')(?:\s+|$)// AND $attr =~ s/^([a-zA-Z0-9_]+)=(?:"([^"]+)"|(.*?)|'([^']+)')(?:\s+|$)// Thank You! Best Regards, Pavel Scherbinin
From: dzirtik [...] gmail.com
I'm sory, of course: $attr =~ s/^(?:"([^"]+)"|'([^']+)'|(.*?))(?:\s+|$)// AND $attr =~ s/^([a-zA-Z0-9_]+)=(?:"([^"]+)"|'([^']+)'|(.*?))(?:\s+|$)// And may be there: $attr =~ s/^([a-zA-Z0-9_]+)\s*=\s*(?:"([^"]+)"|'([^']+)'|(.*?)) (?:\s+|$)// On Thu Mar 29 04:41:54 2012, http://openid.mail.ru/corp/p.scherbinin wrote: Show quoted text
> So, I think RE must look like: > $attr =~ s/^(?:"([^"]+)"|(.*?)|'([^']+)')(?:\s+|$)// > AND > $attr =~ s/^([a-zA-Z0-9_]+)=(?:"([^"]+)"|(.*?)|'([^']+)')(?:\s+|$)//
Thank You! Best Regards, Pavel Scherbinin
Thanks, I will have a look. The problem is that there is no real specification for bbcode, and I try to support the most common things.
I implemented all three features/fixes, they will be in the next version. thanks for your report! tina
I made the signle quoting optional. see option "attribute_quote" v0.14 is on the way to cpan now.