ZF-9220: list+url

Description

last version from /trunk


$bbcode = Zend_Markup::factory('Bbcode', 'Html', array('encoding' => 'windows-1251'));

$a = '
[h3]Foo:[/h3]
[list]
    [*] [url="request.html"]Request[/url]
    [*] [url="settings.html"]Settings[/url]
    [*] [url="database.html"]Database[/url]
    [*] [url="paginator.html"]Paginator[/url]
    [*] [s]Cache[/s] in process
    [*] Additional functions
[/list]
';
$b = $bbcode->render($a);
var_dump($a, $b);
exit;

string(259) "
[h3]Foo:[/h3]
[list]
    [*] [url="request.html"]Request[/url]
    [*] [url="settings.html"]Settings[/url]
    [*] [url="database.html"]Database[/url]
    [*] [url="paginator.html"]Paginator[/url]
    [*] [s]Cache[/s] in process
    [*] Additional functions
[/list]
"
string(343) "

Foo:


Paginator Cache in process Additional functions
"

1) why "http://request.html"? I don't need absolute url, relative needed 2) generated markup isn't readable because it printed in one string 3) generated markup isn't correct

I think that problem appears because url wrapped with quotes. But some links need this wrapping.

Comments

Imho is point 2 bogus. This component isn't meant to beautify HTML, it's meant to output that (at least this renderer is).

Maybe. But sometimes it useful for debugging.

Also relative path needed for anchor links [url=#title1]title1[/url]

ps: sorry for horisontal scroll-bar)

The default URL tag doesn't use relative URL's at all, all URL's are handled as absolute URL's by default.

This behaviour seems to be caused by the fact that the first " is found, but it only uses the last ". Its not really correct behaviour, and I'm going to fix it ASAP.

Also, if you want something that is useful for debugging, do something like:

$parser = $bbcode->getParser();

var_dump($parser->parse('[b]test[/b]'));

Thats much more useful than the output itself.

Added a unit test with a simplified usecase for this.

thank you for fast replay at weekend (y).

Fixed in r21127 and r21128 (merge into 1.10 release branch).